Improve unit test coverage of LoopService