minor fixes and cleanup