Fixed some coding errors and added an extra call to function check_field_lengths to accommodate function add_additional_info