clean up and fix minor compile errors