Fix newlines in record file