anchor.diff:          orelse (E andalso PE)
           orelse x({invalid_error_bit, RC}, answer, [Dir, Pkt]),
   
  -    incr(TPid, Hdr, Dir, rc_counter(Rec, RC)).
  -
  -%% incr/4
  -
  -incr(TPid, Hdr, Dir, Ctr)
  -  when is_tuple(Ctr) ->
  -    incr(TPid, {diameter_codec:msg_id(Hdr), Dir, Ctr});
  -
  -incr(_, _, _, _) ->
  -    false.
  +    irc(TPid, Hdr, Dir, rc_counter(Dict, Rec, RC)).
  +
  +irc(_, _, _, undefined) ->
  +    false;
  +
  +irc(TPid, Hdr, Dir, Ctr) ->
  +    incr(TPid, {diameter_codec:msg_id(Hdr), Dir, Ctr}).
   
   %% incr/2
   
  
positive.code:   when [] == Es;
         is_record(hd(Msg), diameter_header) ->
      Pkt = diameter_codec:encode(Dict, make_answer_packet(Msg, ReqPkt)),
      incr(send, Pkt, TPid),  %% count result codes in sent answers
      send(TPid, Pkt#diameter_packet{transport_data = TD});
  
  %% Or not: set Result-Code and Failed-AVP AVP's.
  
negative.code: %% Maintain statistics assuming one or the other, not both, which is
  %% surely the intent of the RFC.
  
  rc_counter(Dict, Rec, undefined) ->
      er(get_avp_value(Dict, 'Experimental-Result', Rec));
  rc_counter(_, _, RC) ->
      {'Result-Code', RC}.
  
  %% Outgoing answers may be in any of the forms messages can be sent
  %% in. Incoming messages will be records. We're assuming here that the
  %% arity of the result code AVP's is 0 or 1.
  
  er([{_,_,N} = T | _])
    when is_integer(N) ->
      T;
  er({_,_,N} = T)
    when is_integer(N) ->
      T;
  er(_) ->
      undefined.
  
  %% Extract the first good looking integer. There's no guarantee
  %% that what we're looking for has arity 1.
  int([N|_])
    when is_integer(N) ->
      N;
  int(N)
  