Fixes infinite recursion bug