Some fixes to get tests to work