anchor.diff:       {{ModName, precondition, 2}, {[1], false}},
        {{ModName, command, 1}, {[1], false}},
        {{ModName, postcondition, 3}, {[1], false}},
  -     {{ModName, next_state, 3}, {[1], false}}];
  +     {{ModName, next_state, 3}, {[1], true}}];
   
   callbacks(ModName, StateFuns, eqc_fsm) ->
       CallBacks0 = [{{ModName, initial_state_data, 0}, {[], true}},
  
positive.code:     end.
      
   
  get_current_state_type_1(TypeInfo, ModName, _ModInfo, eqc_statem) ->    %% 0 in the [0] means the return type.
      Pars = [{{ModName, initial_state, 0}, [0]}, {{ModName, precondition, 2}, [1]},
  	    {{ModName, command, 1}, [1]}, {{ModName, postcondition, 3}, [1]},
  	    {{ModName, next_state, 3}, [0, 1]}],    
      get_current_state_type_2(TypeInfo, [], Pars);
  
  get_current_state_type_1(TypeInfo, ModName, _ModInfo, eqc_fsm) ->
      Pars0 = [{{ModName, initial_state_data, 0}, [0]}, {{ModName, next_state_data, 5}, [0, 3]},
  	     {{ModName, postcondition, 5}, [3]}, {{ModName, precondition, 4}, [3]}],
      StateFuns = get_eqc_fsm_state_functions(ModName, TypeInfo),
      Pars1 = [{{M, F, A}, [1]} || {M, F, A} <- StateFuns],
      Pars = Pars0 ++ Pars1,
      get_current_state_type_2(TypeInfo, StateFuns, Pars);
  
  get_current_state_type_1(TypeInfo, ModName, ModInfo, gen_fsm) ->
      Pars0 = [{{ModName, init, 1}, {[], true}},
  	     {{ModName, handle_event, 3}, {[3], true}},
  	     {{ModName, handle_sync_event, 4}, {[4], true}},
  	     {{ModName, handle_info, 3}, {[3], true}},
  	     {{ModName, terminate, 3}, {[3], false}},
  	     {{ModName, code_change, 4}, {[3], true}},
  	     {{ModName, enter_loop, 4}, {[4], false}},
  	     {{ModName, enter_loop, 5}, {[4], false}},
  	     {{ModName, enter_loop, 6}, {[4], false}}],
      StateFuns = get_gen_fsm_state_functions(ModName, ModInfo, TypeInfo),
      Pars1 = [{{M, F, A}, {[A], true}} || {M, F, A} <- StateFuns],
      Pars = Pars0 ++ Pars1,
      ?debug("Pars:\n~p\n", [Pars]),
      Fun = fun ({{M, F, A}, RetType, ArgTypes}) ->
  		  case lists:keysearch({M, F, A}, 1, Pars) of
  		    {value, {{M, F, A}, {Is, _ReturnState}}} ->
  			get_gen_fsm_return_types(RetType) ++ 
  			      [lists:nth(I, ArgTypes) || I <- Is];
  		    false ->
  			[]
  		  end
  	  end,
      {lists:append([Fun(T) || T <- TypeInfo]), StateFuns}.
  
  get_current_state_type_2(TypeInfo, StateFuns, Pars) ->
      Fun = fun ({{M, F, A}, RetType, ArgTypes}) ->
  		  case lists:keysearch({M, F, A}, 1, Pars) of
  		      {value, {{M, F, A}, Is}} ->
  			  [case I of
  			       0 -> RetType;
  			       _ -> lists:nth(I, ArgTypes)
  			   end || I <- Is];
  		    false ->
  			  []
  		  end
  	  end,
      {lists:append([Fun(T) || T <- TypeInfo]), StateFuns}.
  
  get_gen_fsm_return_types(RetType) ->
      case RetType of 
  
negative.code: 	_ -> false
      end.
  
  record_to_tuple_fun_name(ModInfo, Funs, RecordName, RecordFields) ->
      FunName = list_to_atom(atom_to_list(RecordName) ++ "_to_tuple"),
      {value, {module, ModName}} = lists:keysearch(module, 1, ModInfo),
      InscopeFuns = refac_util:inscope_funs(ModInfo),
      gen_fun_name(ModName, Funs, RecordName, RecordFields, 
  		 FunName, InscopeFuns, 0, record_to_tuple).
  
  tuple_to_record_fun_name(ModInfo, Funs, RecordName, RecordFields) ->
      FunName = list_to_atom("tuple_to_" ++ atom_to_list(RecordName)),
      {value, {module, ModName}} = lists:keysearch(module, 1, ModInfo),
      InscopeFuns = refac_util:inscope_funs(ModInfo),
      gen_fun_name(ModName, Funs, RecordName, RecordFields, 
  		 FunName, InscopeFuns, 0, tuple_to_record).
  
  
  gen_fun_name(ModName, Funs, RecordName, RecordFields, 
  	     FunName, InscopeFuns, I, C) ->
      NewFunName = case I of 
  		     0 -> FunName;
  		     _ -> 
  