Fix tests, clean up