anchor.diff:  
   decode_avps(Name, Recs) ->
       {Avps, {Rec, Failed}}
  -        = lists:foldl(fun(T,A) -> decode(Name, T, A) end,
  -                      {[], {newrec(Name), []}},
  +        = mapfoldl(fun(T,A) -> decode(Name, T, A) end,
  +                      {newrec(Name), []},
                         Recs),
       {Rec, Avps, Failed ++ missing(Rec, Name, Failed)}.
   %% Append 5005 errors so that errors are reported in the order
  
positive.code: %% occurrence if the peer sends a faulty AVP that we need to respond
  %% sensibly to. Log the occurence for traceability, but the peer will
  %% also receive info in the resulting answer message.
  d(false, Reason, Name, Avp, {Avps, Acc}) ->
      Stack = diameter_lib:get_stacktrace(),
      diameter_lib:log(decode_error,
                       ?MODULE,
                       ?LINE,
                       {Name, Avp#diameter_avp.name, Stack}),
      {Rec, Failed} = Acc,
      {[Avp|Avps], {Rec, [rc(Reason, Avp) | Failed]}}.
  
  %% relax/2
  
  
negative.code: 
      try Mod:avp(decode, Data, AvpName) of
          V ->
              {H, A} = ungroup(V, Avp),
              {H, pack_avp(Name, A, Acc)}
      catch
          throw: {?TAG, {grouped, Error, ComponentAvps}} ->
              g(is_failed(), Error, Name, trim(Avp), Acc, ComponentAvps);
  