Fix bug when deleting an alert.