Resolved mocking issues in loop.