Clean up set_parent method in OrderedTreeNode.