Fixed some bugs with tags