Fix bug where duplicate badges were returned by get_badges_from_tags.