anchor.diff:  %% Tagged types
   encode_obj(Vsn, ?raw(Data)) -> mmd_decode:downgrade_body(Vsn, Data);
   encode_obj(v1_1, Obj) when is_binary(Obj) ->
  -    [?FAST_STRING, encode_obj(v1_1, size(Obj)), Obj];
  -encode_obj(v1_1, 0) -> ?INT0;
  +    Sz = size(Obj),
  +    SSz = ssz(Sz),
  +    <<?FAST_STRING, 1:4, SSz:4, Sz:SSz/unsigned-unit:8, Obj/binary>>;
  +encode_obj(v1_1, 0) -> <<?INT0>>;
   encode_obj(v1_1, Obj) when is_integer(Obj) ->
       case Obj of
  -        O when O >= -128 andalso O < 128 -> [?INT1, <<O:8/signed>>];
  -        O when O > 0 andalso O < 256 -> [?UINT1, <<O:8>>];
  -        O when O >= -32768 andalso O < 32768 -> [?INT2, <<O:16/signed>>];
  -        O when O > 0 andalso O < 65536 -> [?UINT2, <<O:16>>];
  +        O when O >= -128 andalso O < 128 -> <<?INT1, O:8/signed>>;
  +        O when O > 0 andalso O < 256 -> <<?UINT1, O:8>>;
  +        O when O >= -32768 andalso O < 32768 -> <<?INT2, O:16/signed>>;
  +        O when O > 0 andalso O < 65536 -> <<?UINT2, O:16>>;
           O when O >= -2147483648 andalso O < 2147483648 ->
  -            [?INT4, <<O:32/signed>>];
  -        O when O > 0 andalso O < 4294967296 -> [?UINT4, <<O:32>>];
  +            <<?INT4, O:32/signed>>;
  +        O when O > 0 andalso O < 4294967296 -> <<?UINT4, O:32>>;
           O when O >= -9223372036854775808 andalso
                  O < 9223372036854775808 ->
  -            [?INT8, <<O:64/signed>>];
  -        O when O > 0 andalso O < 18446744073709551616 -> [?UINT8, <<O:64>>];
  +            <<?INT8, O:64/signed>>;
  +        O when O > 0 andalso O < 18446744073709551616 -> <<?UINT8, O:64>>;
           O -> ?lerr("Int too big to mmd encode: ~p", [O]), O
       end;
   encode_obj(_, Obj) when is_float(Obj) ->
  -    [?DOUBLE, encode_type(double, Obj)];
  +    <<?DOUBLE, Obj:64/float>>;
   encode_obj(Vsn, Obj) when is_atom(Obj) ->
       encode_obj(Vsn, atom_to_binary(Obj, utf8));
   
  -encode_obj(_, true) -> [?TRUE];
  -encode_obj(_, false) -> [?FALSE];
  -encode_obj(_, undefined) -> [?NULL];
  -encode_obj(_, null) -> [?NULL];
  -encode_obj(_, nil) -> [?NULL];
  +encode_obj(_, true) -> <<?TRUE>>;
  +encode_obj(_, false) -> <<?FALSE>>;
  +encode_obj(_, undefined) -> <<?NULL>>;
  +encode_obj(_, null) -> <<?NULL>>;
  +encode_obj(_, nil) -> <<?NULL>>;
   
   encode_obj(Vsn, ?map(Data)) ->
       {Sz, Body} = encode_map(Vsn, Data),
       case Vsn of
  -        v1_1 -> [?FAST_MAP, encode_obj(v1_1, Sz), Body];
  +        v1_1 ->
  +            SSz = ssz(Sz),
  +            [<<?FAST_MAP, 1:4, SSz:4, Sz:SSz/unsigned-unit:8>>, Body];
           v1_0 -> [?VARINT_MAP, encode_varint(Sz), Body]
       end;
   encode_obj(Vsn, ?array(Data)) ->
       {Sz, Body} = encode_array(Vsn, Data),
       case Vsn of
  -        v1_1 -> [?FAST_ARRAY, encode_obj(v1_1, Sz), Body];
  -        v1_0 -> [?VARINT_ARRAY, encode_type(varint32, Sz), Body]
  +        v1_1 ->
  +            SSz = ssz(Sz),
  +            [<<?FAST_ARRAY, 1:4, SSz:4, Sz:SSz/unsigned-unit:8>>, Body];
  +        v1_0 -> [?VARINT_ARRAY, encode_varint(Sz), Body]
       end;
   encode_obj(v1_1, ?error(Code, Msg)) ->
       [?FAST_ERROR, encode_obj(v1_1, Code), encode_obj(v1_1, Msg)];
  
positive.code:     [?FAST_BYTES, encode_obj(v1_1, size(Data)), Data];
  encode_obj(_, ?byte(Byte)) ->
      [?BYTE, Byte];
  encode_obj(_, ?uuid(Data)) -> [?UUID, encode_type(uuid, Data)];
  encode_obj(_, ?secid(Data)) -> [?SECID, encode_type(secid, Data)];
  encode_obj(v1_1,  ?time(Data)) -> [?FAST_TIME, <<Data:64>>];
  encode_obj(Vsn, Obj) when is_list(Obj) -> encode_obj(Vsn, ?array(Obj));
  encode_obj(Vsn, Obj) when is_tuple(Obj) ->
      encode_obj(Vsn, ?array(tuple_to_list(Obj)));
  
negative.code:     [?VARINT_CHANNEL_CREATE,
       encode_uuid(Chan),
       encode_channel_type(Type),
       encode_varint(size(Svc)),
       Svc,
       encode_varint(Timeout),
       encode_uuid(AT),
       encode_obj(v1_0, Body)];
  encode_message(Vsn, #channel_message{id=Chan, body=Body}) ->
  