Added more unit tests and improved test coverage.