Fix a bug of file saving.