Add inheritance loop detection.