Fix tests and test cleanup