Improve unit test coverage

Code cleanup