Fix addition and removal of tags to correclty store id