Updates labels correctly: if there is an existing tag with the same name, handles that correctly. Also updates the DB.