Fixed infinite loop detection, I hope.