Add decent unit test coverage