Additional tests and cleanups