anchor.diff:  incr_A(_, #diameter_packet{msg = undefined = No}, _, _, _) ->
       No;
   
  -%% Incoming with decode errors.
  -incr_A(recv = D, #diameter_packet{header = H, errors = [_|_]}, _, TPid, _) ->
  -    incr(TPid, {diameter_codec:msg_id(H), D, error});
  -
  -%% Incoming without errors or outgoing. Outgoing with encode errors
  -%% never gets here since encode fails.
  +%% Incoming or outgoing. Outgoing with encode errors never gets here
  +%% since encode fails.
   incr_A(Dir, Pkt, Dict, TPid, Dict0) ->
       #diameter_packet{header = #diameter_header{is_error = E}
                               = Hdr,
  -                     msg = Msg}
  +                     msg = Msg,
  +                     errors = Es}
           = Pkt,
  +
  +    Id = diameter_codec:msg_id(Hdr),
  +
  +    %% Count incoming decode errors.
  +    recv /= Dir orelse [] == Es orelse incr(TPid, {Id, Dir, error}),
   
       %% Exit on a missing result code.
       T = rc_counter(Dict, Msg),
  
positive.code: 
  handle_A(Pkt, SvcName, Dict, Dict0, App, #request{transport = TPid} = Req) ->
      try
          incr_A(recv, Pkt, Dict, TPid, Dict0) %% count incoming result codes
      of
          _ -> answer(Pkt, SvcName, App, Req)
      catch
  
negative.code:     Pkt = encode(Dict,
                   reset(make_answer_packet(Msg, ReqPkt), Dict, Dict0),
                   Fs),
      incr_A(send, Pkt, Dict, TPid, Dict0),  %% count outgoing
      send(TPid, Pkt).
  
  %% reset/3
  