Fix bug of memory mapping file writing.