fix errors found in unit test