Fix the bug of fclose file.