Fixes infinite recursion bug.