Fix task deletion