Fix InheritanceManager when the model has a self reference.

Otherwise, we reach max recursion depth.