Fix cleanup for failed jobs.