More tests, and cleanup