Misc unit test fixes

Fixes so these tests can be run independently or in random order.