#1158 Unit test fixes