Improve test setup, fix old tests