more tests and cleanup