fix issues found by jchauncey