Fixed body file writing.