Infinite loop checking.