Fixed endless loop.