Fix tests, cleanups