fix errors found during testing