Fix bug of writing file function. Adjust message buffer size.