minor fixes and clean up