anchor.diff:  proxy_add_via(Header, Method, OrigURI, Parameters, SocketProto, SrvTHandler) ->
       ViaHostname = myhostname(),
       LoopCookie = case sipserver:get_env(detect_loops, true) of
  -	true ->
  -	    get_loop_cookie(Header, OrigURI);
  -	false ->
  -	    none
  -    end,
  +		     true ->
  +			 get_loop_cookie(Header, OrigURI);
  +		     false ->
  +			 none
  +		 end,
       ParamDict = sipheader:param_to_dict(Parameters),
       ViaParameters1 = case dict:find("branch", ParamDict) of
  -	error ->
  -	    case stateless_generate_branch(OrigURI, Header) of
  -		error ->
  -		    Parameters;
  -		Branch ->
  -		    % In order to find the correct "server transaction" (ie. TCP socket) to use
  -		    % when sending future responses to this request back upstreams, we need to
  -		    % associate the stateless branch we generated with the socket the request
  -		    % we are now proxying arrived on. If it is a TCP socket.
  -		    % We don't check for errors since sockets can vanish but we can route
  -		    % responses using the information in Via too.
  -		    case Method of
  -			"ACK" -> true;	% ACK is part of INVITE transaction or does not get responded to
  -			_ ->
  -			    transactionlayer:store_stateless_response_branch(SrvTHandler, Branch, Method)
  -		    end,
  -		    NewBranch = case LoopCookie of
  -			none ->
  -			    logger:log(debug, "Siprequest: Added statelessly generated branch ~p to request",
  -						[Branch]),
  -			    Branch;
  -			_ ->
  -			    NewBranch1 = Branch ++ "-o" ++ LoopCookie,
  -			    logger:log(debug, "Siprequest: Added statelessly generated branch (plus loop cookie) ~p to request",
  -						[NewBranch1]),
  -			    NewBranch1
  -			end,
  -		    Param2 = dict:store("branch", NewBranch, ParamDict),
  -	    	    sipheader:dict_to_param(Param2)
  -	    end;
  -	{ok, Branch} when LoopCookie /= none ->
  -	    %% Check if there already is a loop cookie in this branch. Necessary to not
  -	    %% get the wrong branch in constructed ACK of non-2xx response to INVITE.
  -	    FlatBranch = lists:flatten(Branch),
  -	    case string:rstr(FlatBranch, "-o") of
  -		0 ->
  -		    logger:log(debug, "Siprequest: Added loop cookie ~p to branch of request",
  -					[LoopCookie]),
  -		    Param2 = dict:append("branch", "-o" ++ LoopCookie, ParamDict),
  -		    sipheader:dict_to_param(Param2);
  -		Index when integer(Index) ->
  -		    % There is already a loop cookie in this branch, don't change it. Necessary to not
  -		    % get the wrong branch in constructed ACK of non-2xx response to INVITE.
  -		    logger:log(debug, "Siprequets: NOT adding generated loop cookie ~p to branch that already " ++
  -				"contains a loop cookie : ~p", [LoopCookie, FlatBranch]),
  -		    Parameters
  -	    end;
  -	{ok, Branch} ->
  -	    %% Request has a branch, and loop detection is off (or get_loop_cookie() returned 'none').
  -	    Parameters
  -    end,
  +			 error ->
  +			     case stateless_generate_branch(OrigURI, Header) of
  +				 error ->
  +				     Parameters;
  +				 Branch ->
  +				     %% In order to find the correct "server transaction" (ie. TCP socket) to use
  +				     %% when sending future responses to this request back upstreams, we need to
  +				     %% associate the stateless branch we generated with the socket the request
  +				     %% we are now proxying arrived on. If it is a TCP socket.
  +				     %% We don't check for errors since sockets can vanish but we can route
  +				     %% responses using the information in Via too.
  +				     case Method of
  +					 "ACK" -> true;	% ACK is part of INVITE transaction or does not get responded to
  +					 _ ->
  +					     transactionlayer:store_stateless_response_branch(SrvTHandler, Branch, Method)
  +				     end,
  +				     NewBranch = case LoopCookie of
  +						     none ->
  +							 logger:log(debug, "Siprequest: Added statelessly generated branch ~p to request",
  +								    [Branch]),
  +							 Branch;
  +						     _ ->
  +							 NewBranch1 = Branch ++ "-o" ++ LoopCookie,
  +							 logger:log(debug, "Siprequest: Added statelessly generated branch (plus loop cookie) ~p to request",
  +								    [NewBranch1]),
  +							 NewBranch1
  +						 end,
  +				     Param2 = dict:store("branch", NewBranch, ParamDict),
  +				     sipheader:dict_to_param(Param2)
  +			     end;
  +			 {ok, Branch} when LoopCookie /= none ->
  +			     %% Check if there already is a loop cookie in this branch. Necessary to not
  +			     %% get the wrong branch in constructed ACK of non-2xx response to INVITE.
  +			     FlatBranch = lists:flatten(Branch),
  +			     case string:rstr(FlatBranch, "-o") of
  +				 0 ->
  +				     logger:log(debug, "Siprequest: Added loop cookie ~p to branch of request",
  +						[LoopCookie]),
  +				     Param2 = dict:append("branch", "-o" ++ LoopCookie, ParamDict),
  +				     sipheader:dict_to_param(Param2);
  +				 Index when integer(Index) ->
  +				     %% There is already a loop cookie in this branch, don't change it. Necessary to not
  +				     %% get the wrong branch in constructed ACK of non-2xx response to INVITE.
  +				     logger:log(debug, "Siprequets: NOT adding generated loop cookie ~p to branch that already " ++
  +						"contains a loop cookie : ~p", [LoopCookie, FlatBranch]),
  +				     Parameters
  +			     end;
  +			 {ok, Branch} ->
  +			     %% Request has a branch, and loop detection is off (or get_loop_cookie() returned 'none').
  +			     Parameters
  +		     end,
       ViaPort = default_port(sipserver:get_env(listenport, none)),
       ViaParameters = case sipserver:get_env(request_rport, false) of
  -	true ->
  -	    lists:append(ViaParameters1, ["rport"]);
  -	_ ->
  -	    ViaParameters1
  -    end,
  +			true ->
  +			    lists:append(ViaParameters1, ["rport"]);
  +			_ ->
  +			    ViaParameters1
  +		    end,
       MyVia = sipheader:via_print([{sipsocket:sipproto2viastr(SocketProto),
  -				 {ViaHostname, ViaPort}, ViaParameters}]),
  +				  {ViaHostname, ViaPort}, ViaParameters}]),
       keylist:prepend({"Via", MyVia}, Header).
   
   stateless_generate_branch(OrigURI, Header) ->
  -    % generate a branch for this request in a way that makes sure that we generate
  -    % the same branch for a retransmission of this very same request. RFC3261 #16.11
  +    %% generate a branch for this request in a way that makes sure that we generate
  +    %% the same branch for a retransmission of this very same request. RFC3261 #16.11
       TopVia = sipheader:topvia(Header),
       case TopVia of
   	{_, {ViaHostname, ViaPort}, Parameters} ->
  
positive.code:     format_dst_list(InHost, InPort, T, Res);
  format_dst_list(InHost, InPort, [H | T], Res) ->
      logger:log(debug, "Warning: Unrecognized element returned from dnsutil:siplookup() on host ~p : ~p",
  		[InHost, H]),
      format_dst_list(InHost, InPort, T, Res).
  
  rewrite_route(Header, URI) ->
  
negative.code:     send_response(Socket, 302, "Moved Temporarily",
  		  standardcopy(Header, ExtraHeaders),
  		  "").
  
  
  send_notfound(Header, Socket) ->
      send_response(Socket, 404, "Not found",
  