Avoid infinite recursion
Merge pull request #2038 from wmtan/AvoidInfiniteRecursion

Avoid infinite recursion