Fix bug with setting tags