some minor fixes and clean up