Fix possible infinite loop.