Fixed a fatal bug of file saving.