Moar cleanup and general fixes.