Ensure test data is created and other fixes