Fix a small bug in the tree management of the simple legend editor