Fix tests and clean up some things.