Fixed bug in the get_record loop - crashed when diagrec was received.