cleanup and fix more tests