Fix tag deletion bug