More robust task deletion

Don't forget to change this log message to read from the new var.