Clean up code, and fix stuff.