Fixing the Type::isOneOfParents() stack overflow bug