Fix a bug in the tag tree