anchor.diff:  	    Fields = refac_syntax:record_expr_fields(Node),
   	    case refac_syntax:type(Type) of 
   		atom -> 
  -		    Type1 = refac_syntax:concrete(Type),
  -		    case lists:keysearch(Type1, 1, RecordInfo) of 
  -			{value, {Type1, Fields1}} ->
  -			    Fields2 = lists:map(fun(F) -> {F, Fields} end, Fields1),
  -			    NormalisedFields =lists:map(Fun, Fields2),
  -			    refac_syntax:record_expr(Arg, Type, NormalisedFields);
  +		    case lists:keysearch(refac_syntax:concrete(Type), 1, RecordInfo) of 
  +			{value, {_, Fields1}} ->
  +			    Fields2 = lists:append([Fun(F, Fields) || F <- Fields1]),
  +			    refac_util:rewrite(Node, refac_syntax:record_expr(Arg, Type, Fields2));
   			_ -> 
  -			    %% ?wrangler_io("Warning: wrangler could not find the definition of record '~p'.\n",[Type1]),
   			    Node
   		    end;
   		_ -> Node
   	    end;
  -	_ -> Node
  -    end.
  -    
  -	    
  -collect_record_types(Tree) ->
  -    F = fun(T,S) ->
  -		case refac_syntax:type(T) of
  -		    record_expr ->
  -			S ++ [refac_syntax:record_expr_type(T)];
  -		    _ -> S
  -		end
  -	end,
  -    refac_syntax_lib:fold(F, [], Tree).
  -
  +	_ ->Node
  +    end.
  +
  +set_random_pos(Node) ->    
  +    refac_syntax:set_pos(Node, {(-random:uniform(200)), -(random:uniform(200))}).
  + 
   pos_to_record_expr(Tree, Pos) ->
       case refac_util:once_tdTU(fun pos_to_record_expr_1/2, Tree, Pos) of 
   	{_, false} ->
  -	     throw({error, "You have not selected a record expression"});
  +	     throw({error, "You have not selected a record expression, "
  +		   "or the function containing the record expression selected does not parse."});
   	{R, true} -> 
   	    R
       end.
  
positive.code: 		    _ -> ?DefaultSimiScore
  		end,    
      {ok, {AnnAST, _Info}} = refac_util:parse_annotate_file(FName, true, [], TabWidth),
      Exprs= refac_util:pos_to_expr_list(FName, AnnAST, Start, End, TabWidth),
      case Exprs of 
  	[] -> throw({error, "You have not selected an expression!"});
  	_ -> ok
      end,
      RecordInfo =get_module_record_info(FName, SearchPaths, TabWidth),
      Exprs1 = case length(Exprs) of 1 -> hd(Exprs); _ -> Exprs end,
     ?wrangler_io("The selected expression after normalisation is:",
  		[]),
      Res =do_search_similar_expr(AnnAST, RecordInfo, Exprs1, SimiScore),
      Res1 = lists:map(fun({Range, _, _})-> Range end, Res),
      SE = get_start_end_loc(Exprs),
      Res2 = lists:usort([SE| Res1--[SE]]),
      AntiUnifier = generalise_expr(normalise_record_expr(Exprs1,RecordInfo),Res),
      Num = length(Res2), 
      case Num =<1 of 
  	true -> ?wrangler_io("No similar expression has been found.\n",[]); 
  	false-> ?wrangler_io("~p expressions (including the expression selected) which are similar to the expression selected have been found. \n", [Num]),
  		?wrangler_io(compose_search_result_info(FName, Res2),[]),
  		?wrangler_io("\nThe generalised expression would be:\n\n~s\n\n", [refac_prettypr:format(AntiUnifier)]),
  		?wrangler_io("\nUse 'C-c C-e' to remove highlights!\n",[]),
  		{ok, Res2}
      end.
     
  
  do_search_similar_expr(AnnAST, RecordInfo, Exprs, SimiScore) when is_list(Exprs) ->
        F = fun(T, Acc) ->
  		  case refac_syntax:type(T) of
  		      clause -> Exprs1 = refac_syntax:clause_body(T),
  				do_search_similar_expr_1(Exprs, Exprs1, RecordInfo, SimiScore)++Acc;
  		      block_expr -> Exprs1 = refac_syntax:block_expr_body(T),
  				    do_search_similar_expr_1(Exprs, Exprs1, RecordInfo, SimiScore)++Acc;
  		      _  -> Acc
  		  end
  	  end,
      lists:reverse(refac_syntax_lib:fold(F, [], AnnAST));
  
  do_search_similar_expr(AnnAST, RecordInfo, Expr, SimiScore) ->
      {EStart, EEnd} = get_start_end_loc(Expr),
      F = fun(Node, Acc) ->
  		case refac_util:is_expr(Node) of 
  		    true ->
  			{NStart, NEnd} = get_start_end_loc(Node),
  			case (EStart =< NStart andalso  NEnd =< EEnd) orelse
  			    (NStart =< EStart andalso EEnd =< NEnd) of 
  			    true -> Acc;
  			    _ ->
  				find_anti_unifier(Expr, Node, RecordInfo, SimiScore) ++ Acc
  			end;
  		    _ -> Acc
  		end
  	end,
      lists:reverse(refac_syntax_lib:fold(F, [], AnnAST)).
  
   
  do_search_similar_expr_1(Exprs1, Exprs2, RecordInfo, SimiScore) ->
      Len1 = length(Exprs1),
      Len2 = length(Exprs2),
      case Len1 =< Len2 of 
  
negative.code:     DefaultIncl2 = [filename:join(Dir, X) || X <-DefaultIncl1],
      Includes = SearchPaths++DefaultIncl2,
      case refac_epp:parse_file(FName, Includes,[], TabWidth, refac_util:file_format(FName)) of 
  	{ok, Forms, _} -> Forms1 =[F || F <-Forms, case F of 
  						       {attribute, _, file, _} -> false;
  						       {attribute, _, type, {{record, _}, _, _}} -> false;
  						       _ -> true
  						   end],
  			  SyntaxTree = refac_recomment:recomment_forms(Forms1,[]),
  			  Info = refac_syntax_lib:analyze_forms(SyntaxTree),
  			  case lists:keysearch(records,1, Info) of 
  