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:     is_result(RC, E, Dict0)
          orelse x({invalid_error_bit, RC}, answer, [Dir, Pkt]),
  
      incr(TPid, {diameter_codec:msg_id(Hdr), Dir, Ctr}).
  
  %% No E-bit: can't be 3xxx.
  is_result(RC, false, _Dict0) ->
  
negative.code: 
  handle_A(Pkt, SvcName, Dict, Dict0, App, #request{transport = TPid} = Req) ->
      try
          incr_A(recv, Pkt, Dict, TPid, Dict0) %% count incoming
      of
          _ -> answer(Pkt, SvcName, App, Req)
      catch
  