Improve unit test coverage of loop/log