Fixed tests and cleanups.