anchor.diff:          false ->
               Rest2 = skip_field(Rest, WireType),
               decode_field(MsgDef, MsgDefs, Rest2, Msg);
  -        #field{type = FieldType, opts=Opts} = FieldDef ->
  -            {NewValue, Rest2} = decode_type(FieldType, Rest, MsgDefs,
  -                                            proplists:get_bool(packed, Opts)),
  -            NewMsg = add_field(NewValue, FieldDef, MsgDefs, Msg),
  -            decode_field(Rest2, MsgDef, MsgDefs, NewMsg)
  +        #field{type = FieldType, rnum=RNum, opts=Opts} = FieldDef ->
  +            case proplists:get_bool(packed, Opts) of
  +                true ->
  +                    AccSeq = element(RNum, Msg),
  +                    {NewSeq, Rest2} = decode_packed(FieldType, Rest, MsgDefs,
  +                                                   AccSeq),
  +                    NewMsg = setelement(RNum, Msg, NewSeq),
  +                    decode_field(Rest2, MsgDef, MsgDefs, NewMsg);
  +                false ->
  +                    {NewValue, Rest2} = decode_type(FieldType, Rest, MsgDefs),
  +                    NewMsg = add_field(NewValue, FieldDef, MsgDefs, Msg),
  +                    decode_field(Rest2, MsgDef, MsgDefs, NewMsg)
  +            end
       end;
   decode_field(<<>>, MsgDef, _MsgDefs, Record0) ->
       %% Reverse any repeated fields, but only on the top-level, not recursively.
  
positive.code: append_to_element(RNum, NewElem, Record) ->
      PrevElems = element(RNum, Record),
      setelement(RNum, Record, [NewElem | PrevElems]).
  
  append_packed_to_element(RNum, NewElems, Record) ->
      PrevElems = element(RNum, Record),
      setelement(RNum, Record, lists:reverse(NewElems, PrevElems)).
  
  merge_msgs(PrevMsg, NewMsg, MsgDefs)
    when element(1,PrevMsg) == element(1,NewMsg) ->
  
negative.code:             %%
              %% 10 bytes is what it takes to varint-encode a -1 as a 64
              %% bit signed int. -1 as a 32 bit signed int is only 5 bytes.
              decode_type(int64, Bin, MsgDefs);
          int64 ->
              {NV, T} = decode_varint(Bin),
              <<N:64/signed>> = <<NV:64>>,
  