anchor.diff:  		case refac_syntax:type(T) of
   		  function ->
   		      N = refac_syntax:function_name(T),
  -		      case refac_syntax:type(N) of
  -			atom ->
  -			    case lists:member(refac_syntax:atom_value(N), AtomNames) of
  -			      true -> S ++ [{function, refac_syntax:get_pos(N)}];
  -			      false -> S
  +		      collect_atoms_1(AtomNames, S, N, function);
  +		  application ->
  +		      Operator = refac_syntax:application_operator(T),
  +		      collect_atoms_1(AtomNames, S, Operator, function);
  +		  module_qualifier ->
  +		      Mod = refac_syntax:module_qualifier_argument(T),
  +		      Fun = refac_syntax:module_qualifier_body(T),
  +		      S1 = collect_atoms_1(AtomNames, S, Mod, module),
  +		      collect_atoms_1(AtomNames, S1, Fun, function);
  +		  arity_qualifier ->
  +		      Fun = refac_syntax:arity_qualifier_body(T),
  +		      case lists:member(refac_syntax:atom_value(Fun), AtomNames) of
  +			true -> S ++ [{function, refac_syntax:get_pos(Fun)}];
  +			false -> S
  +		      end;
  +		  infix_expr ->
  +		      Op = refac_syntax:infix_expr_operator(T),
  +		      Left = refac_syntax:infix_expr_left(T),
  +		      case refac_syntax:operator_name(Op) of
  +			'!' ->
  +			    case refac_syntax:type(Left) of
  +			      atom ->
  +				  case lists:member(refac_syntax:atom_value(Left), AtomNames) of
  +				    true ->
  +					S ++ [{process, refac_syntax:get_pos(Left)}];
  +				    _ -> S
  +				  end;
  +			      _ -> S
   			    end;
   			_ -> S
   		      end;
  -		  application ->
  -		      Operator = refac_syntax:application_operator(T),
  -		      case refac_syntax:type(Operator) of
  -			atom ->
  -			    case lists:member(refac_syntax:atom_value(Operator), AtomNames) of
  -			      true ->
  -				  S ++ [{function, refac_syntax:get_pos(Operator)}];
  -			      false -> S
  -			    end;
  -			_ -> S
  -		      end;
  -		  module_qualifier ->
  -		      Mod = refac_syntax:module_qualifier_argument(T),
  -		      Fun = refac_syntax:module_qualifier_body(T),
  -		      S1 = case refac_syntax:type(Mod) of
  -			     atom ->
  -				 case lists:member(refac_syntax:atom_value(Mod), AtomNames) of
  -				     true ->
  -					 S ++ [{module, refac_syntax:get_pos(Mod)}];
  -				    false -> S
  -				 end;
  -			       _ -> S
  -			   end,
  -		      case refac_syntax:type(Fun) of
  -			  atom ->
  -			      case lists:member(refac_syntax:atom_value(Fun), AtomNames) of
  -				  true -> S1 ++ [{function, refac_syntax:get_pos(Fun)}];
  -				  false -> S1
  -			      end;
  -			_ -> S1
  -		      end;
  -		  arity_qualifier ->
  -			Fun = refac_syntax:arity_qualifier_body(T),
  -			case lists:member(refac_syntax:atom_value(Fun), AtomNames) of
  -			    true -> S ++ [{function, refac_syntax:get_pos(Fun)}];
  -			    false -> S
  -			end;
  -		  infix_expr ->
  -			Op = refac_syntax:infix_expr_operator(T),
  -			Left = refac_syntax:infix_expr_left(T),
  -			case refac_syntax:operator_name(Op) of
  -			    '!' ->
  -				case refac_syntax:type(Left) of
  +		  record_expr -> Type = refac_syntax:record_expr_type(T),
  +				 collect_atoms_1(AtomNames, S, Type, record);
  +		  record_field -> Name = refac_syntax:record_field_name(T),
  +				  case refac_syntax:type(Name) of
   				    atom ->
  -					case lists:member(refac_syntax:atom_value(Left),AtomNames) of
  -					    true ->
  -						S ++ [{process, refac_syntax:get_pos(Left)}];
  -					    _ -> S
  +					case lists:member(refac_syntax:atom_value(Name), AtomNames) of
  +					  true ->
  +					      S ++ [{record, refac_syntax:get_pos(Name)}];
  +					  _ -> S
   					end;
   				    _ -> S
  -				end;
  -			    _ -> S
  -			end;
  -		    record_expr -> Type = refac_syntax:record_expr_type(T),
  -				   case refac_syntax:type(Type) of 
  -				       atom -> 
  -					   case lists:member(refac_syntax:atom_value(Type), AtomNames) of 
  -					       true ->
  -						   S ++ [{record, refac_syntax:get_pos(Type)}];
  -					       false ->
  -						   S
  -					   end;
  -				       _ -> S
  +				  end;
  +		  record_access -> Type = refac_syntax:record_access_type(T),
  +				   Field = refac_syntax:record_access_field(T),
  +				   S1 = collect_atoms_1(AtomNames, S, Type, record),
  +				   case refac_syntax:type(Field) of
  +				     atom ->
  +					 case lists:member(refac_syntax:atom_value(Field), AtomNames) of
  +					   true ->
  +					       S ++ [{record, refac_syntax:get_pos(Field)}];
  +					   false ->
  +					       S
  +					 end;
  +				     _ -> S1
   				   end;
  -		    record_field -> Name = refac_syntax:record_field_name(T),
  -				    case refac_syntax:type(Name) of 
  -					atom -> 
  -					    case lists:member(refac_syntax:atom_value(Name), AtomNames) of
  -						true ->
  -						    S ++ [{record, refac_syntax:get_pos(Name)}];
  -						_ -> S
  -					    end;
  -					_ -> S
  -				    end;				   
  -		    record_access -> Type = refac_syntax:record_access_type(T),
  -				     Field = refac_syntax:record_access_field(T),
  -				     S1 =case refac_syntax:type(Type) of 
  -					     atom -> 
  -						 case lists:member(refac_syntax:atom_value(Type), AtomNames) of 
  -						     true ->
  -							 S ++ [{record, refac_syntax:get_pos(Type)}];
  -						     false ->
  -							 S
  -						 end;
  -					     _ -> S
  -					 end,
  -				     case refac_syntax:type(Field) of 
  -					 atom -> 
  -					     case lists:member(refac_syntax:atom_value(Field), AtomNames) of 
  -						 true ->
  -						     S ++ [{record, refac_syntax:get_pos(Field)}];
  -						 false ->
  -						     S
  -					     end;
  -					 _ -> S1
  -				     end;
  -		    atom ->
  -			case lists:member(refac_syntax:atom_value(T), AtomNames) of
  -			    true ->
  -				Pos = refac_syntax:get_pos(T), S ++ [{atom, Pos}];
  -			    false -> S
  -			end;
  -		    _ -> S
  +		  atom ->
  +		      case lists:member(refac_syntax:atom_value(T), AtomNames) of
  +			true ->
  +			    Pos = refac_syntax:get_pos(T), S ++ [{atom, Pos}];
  +			false -> S
  +		      end;
  +		  _ -> S
   		end
   	end,
       refac_syntax_lib:fold(F, [], Tree).
   
  +collect_atoms_1(AtomNames, S, Node, Type) ->
  +    case refac_syntax:type(Node) of
  +      atom ->
  +	    case lists:member(refac_syntax:atom_value(Node), AtomNames) of
  +		true ->
  +		    S ++ [{Type, refac_syntax:get_pos(Node)}];
  +		false ->
  +		    S
  +	    end;
  +	_ -> S
  +    end.
  +
   
   transform_apply_style_calls(FileName, Node, {ModName, FunName, Arity}, NewFunName, SearchPaths, TabWidth) ->
       Operator = refac_syntax:application_operator(Node),
       Arguments = refac_syntax:application_arguments(Node),
  -    [N1, N2, Mod, Fun, Args] = case length(Arguments) of 
  -				   5 -> Arguments;
  -				   4 -> [none | Arguments];
  -				   3 -> [none , none| Arguments]
  -			       end,					
  +    [N1, N2, Mod, Fun, Args] = case length(Arguments) of
  +				 5 -> Arguments;
  +				 4 -> [none| Arguments];
  +				 3 -> [none, none| Arguments]
  +			       end,
       Mod1 = try_eval(FileName, Mod, SearchPaths, TabWidth),
       Fun1 = try_eval(FileName, Fun, SearchPaths, TabWidth),
       case Fun1 of
  -	{value, FunName} ->
  -	    case Mod1 of
  -		{value, ModName} ->
  -		    case ((refac_syntax:type(Args)==list) andalso (refac_syntax:list_length(Args)==Arity)) orelse
  -			((refac_syntax:type(Args)==nil) andalso Arity==0) of 
  -			true ->
  -			    Fun2 = refac_syntax:atom(NewFunName),
  -			    App = case length(Arguments) of
  -				      5 -> refac_syntax:application(Operator, [N1,N2, Mod, Fun2, Args]);
  -				      4 -> refac_syntax:application(Operator, [N2, Mod, Fun2, Args]);
  -				      3 -> refac_syntax:application(Operator, [Mod, Fun2, Args])
  -				  end,
  -			    {copy_pos_attrs(Node, App), true};
  -			false -> {Node, false}
  -		    end;
  -		_ ->
  -		    {Node, false}
  -	    end;
  -	{value, _} -> {Node, false};
  -	{error, _Reason} -> {Node, false}
  +      {value, FunName} ->
  +	  case Mod1 of
  +	    {value, ModName} ->
  +		case refac_syntax:type(Args) == list andalso refac_syntax:list_length(Args) == Arity orelse
  +		       refac_syntax:type(Args) == nil andalso Arity == 0
  +		    of
  +		  true ->
  +		      Fun2 = refac_syntax:atom(NewFunName),
  +		      App = case length(Arguments) of
  +			      5 -> refac_syntax:application(Operator, [N1, N2, Mod, Fun2, Args]);
  +			      4 -> refac_syntax:application(Operator, [N2, Mod, Fun2, Args]);
  +			      3 -> refac_syntax:application(Operator, [Mod, Fun2, Args])
  +			    end,
  +		      {rewrite(Node, App), true};
  +		  false -> {Node, false}
  +		end;
  +	    _ ->
  +		{Node, false}
  +	  end;
  +      {value, _} -> {Node, false};
  +      {error, _Reason} -> {Node, false}
       end.
   
   %% =====================================================================
  
positive.code: 	"WARNING: Wrangler could not infer whether the uses of " ++ atom_to_list(FunName)++ 
  	" at the following positions refer to the function renamed, and they are not renamed."
  	" Please check manually!\n".
       
  
  
  start_atom_process() ->
  
negative.code: output_atom_warning_msg(Pid,NotRenamedWarnMsg, RenamedWarnMsg) ->
      Pid ! {self(), get},
      receive
  	{Pid, {NotRenamed, Renamed}} ->
  	    output_atom_warnings({NotRenamed, Renamed}, NotRenamedWarnMsg,RenamedWarnMsg);
  	_ -> throw({error, "Refactoring failed because of a Wrangler error."})
      end.
  
      
  output_atom_warnings({[], []}, _, _) ->
      ok;
  output_atom_warnings({NotRenamed, Renamed}, NotRenamedMsg, RenamedMsg) ->
      output_atom_not_renamed_warnings(NotRenamed, NotRenamedMsg),
      output_atom_renamed_warnings(Renamed,  RenamedMsg).
  
  output_atom_not_renamed_warnings([],  _Msg) -> ok;
  