Fixed bug in TruncateFile.