Small improvements to unit test code