moar cleanup and fixes