Clean up and fix tests.