Debugging potential infinite loop