anchor.diff:  		  end
   	  end,
       Forms0 = [Fun(F) || F <- Forms],
  -    refac_syntax:form_list(Forms0).
  -   
  +    Forms1 = unfold_conversion_apps(Forms0, RecordToTupleFunName, TupleToRecordFunName, RecordName, RecordFields, IsTuple),    
  +    Forms2 = add_util_funs(Forms1, ModInfo, RecordName, RecordFields,TupleToRecordFunName, RecordToTupleFunName),
  +    case RecordExists of
  +      true ->
  +	  refac_syntax:form_list(Forms2);
  +      false ->
  +	  RecordDef = mk_record_attribute(RecordName, RecordFields),
  +	  NewForms =  insert_record_attribute(Forms2, RecordDef),
  +	  refac_syntax:form_list(NewForms)
  +    end.
  +
   do_state_to_record_1(ModName, Fun, RecordName, RecordFields, StateFuns, IsTuple, 
   		     SM, TupleToRecordFunName, RecordToTupleFunName) ->
       As = refac_syntax:get_ann(Fun),
  
positive.code: 
  -include("../include/wrangler.hrl").
  
  -define(Msg, "Wrangler failed to infer the current data type of the state.").
  
  %% =============================================================================================
  
negative.code: 
  
  do_state_to_record(ModName, ModInfo,  AnnAST, RecordName, RecordFields, StateFuns, RecordExists, IsTuple, SM) ->
      Forms = refac_syntax:form_list_elements(AnnAST),
      Funs = get_possible_conversion_funs(Forms, RecordName),
      TupleToRecordFunName = tuple_to_record_fun_name(ModInfo, Funs, RecordName, RecordFields),
      RecordToTupleFunName = record_to_tuple_fun_name(ModInfo, Funs, RecordName, RecordFields),
      Fun = fun (F) ->
  