Correct a bug in TreeNode destructor