fix silly error with writing a smaller value not truncating the file.