Lots of test fixes