Merge "Add a debug assert to track down infinite loop"