fix errors in test and code coverage