Avoid infinite loop if object is its own parent