Spec and test fixes for master branch