Fixed a bug where the buildRecord method did not refreshed the field_ref
and/or value_ref according to a new value and/or field ID read from the
application_data table then tried to reach an uninitialized index of the
ref arrays to build up the record.