Fix tag count calculation when deleting links