Moar tests and cleanups