Make failed_task robust