code coverage and bug fixes