Check for recursive ancestors