Correctly generate unique list of tags