adding bits of unit test coverage, bug fixes