Bugfix: prevent inifinity looping.