TRQ-2643. Fix a looping issue.