Correct a bug which holds a file handle