Fix bug when calling Fail or done with error