various minor fixes and clean up