More tests, cleanup.