more tests fix more bugs