This is not a correct fix. See the comment above about the need for caching to avoid infinite recursion. This fix will re-enable infinite recursion bugs if gag is set.