Clean up code and fix tests