Fix endless loop.