Fixes unending loop.