Lots of test improvements