Fixed a potential bug in the tag stack with tags sharing the same position being added after the initial sort. Also, the tags are not systematically sorted anymore if they're already in the right order