anchor.diff:  	    nomatch
       end.
   
  -get_forwards_for_users([]) ->
  -    [];
  -get_forwards_for_users([User | Rest]) ->
  -    lists:append(get_forward_for_user(User), get_forwards_for_users(Rest)).
  +get_forwards_for_users(In) ->
  +    get_forwards_for_users2(In, []).
  +
  +get_forwards_for_users2([], Res) ->
  +    lists:usort(Res);
  +get_forwards_for_users2([H | T], Res) ->
  +    case get_forward_for_user(H) of
  +	error ->
  +	    error;
  +	nomatch ->
  +	    get_forwards_for_users2(T, Res);
  +	Fwd ->
  +	    get_forwards_for_users2(T, lists:append(Res, [Fwd]))
  +    end.
   
   get_forward_for_user(User) ->
       case database_forward:fetch(User) of
   	{atomic, []} ->
   	    logger:log(debug, "userdb-mnesia: No forwards found for user ~p", [User]),
  -	    [];
  +	    nomatch;
   	{atomic, [F]} ->
   	    F;
   	Unknown ->
   	    logger:log(error, "userdb-mnesia: Unexpected result from database_forward:fetch(), user ~p result : ~p",
   		       [User, Unknown]),
  -	    []
  -    end.
  +	    error
  +    end.
  
positive.code: 	{atomic, []} ->
  	    case phone:get_users_for_number(Address) of
  		{atomic, []} ->
  		    logger:log(debug, "userdb-mnesia: No user with number ~p", [Address]),
  		    nomatch;
  		{atomic, [User]} ->
  		    User;
  
negative.code: 	 get_forward_for_user/1
  	]).
  
  -include("siprecords.hrl").
  
  %% Mnesia userdb module
  
  