some minor fixes and cleanup