Fix bug in opening of record file.