Fix deleting a node in the tree structure.