anchor.diff:  	Len ->
   	    << 16#DD:8, Len:32/big-unsigned-integer-unit:1,(pack_array_(L, <<>>))/binary >>
       end.
  +
   pack_array_([], Acc) -> Acc;
   pack_array_([Head|Tail], Acc) ->
  -    pack_array_(Tail, <<Acc/binary,  (pack(Head))/binary>>).
  -
  -% FIXME! this should be without lists:reverse/1
  -unpack_array_(<<>>, 0, RetList)   -> {lists:reverse(RetList), <<>>};
  -unpack_array_(Remain, 0, RetList) when is_binary(Remain)-> {lists:reverse(RetList), Remain};
  -unpack_array_(<<>>, RestLen, _RetList) when RestLen > 0 ->  {more, undefined};
  -unpack_array_(Bin, RestLen, RetList) when is_binary(Bin)->
  -    case unpack(Bin) of
  -	{more, _} -> {more, undefined};
  -	{Term, Rest}-> unpack_array_(Rest, RestLen-1, [Term|RetList])
  -    end.
  +    pack_array_(Tail, <<Acc/binary,  (pack_(Head))/binary>>).
  +
  +% Users SHOULD NOT send too long list: this uses lists:reverse/1
  +unpack_array_(Remain, 0,    Acc) when is_binary(Remain)-> {lists:reverse(Acc), Remain};
  +unpack_array_(<<>>, RestLen,  _) when RestLen > 0 -> throw(short);
  +unpack_array_(Bin, RestLen, Acc) when is_binary(Bin)->
  +    {Term, Rest}=unpack_(Bin),
  +    unpack_array_(Rest, RestLen-1, [Term|Acc]).
   
   pack_map_([], Acc) -> Acc;
   pack_map_([{Key,Value}|Tail], Acc) ->
  -    pack_map_(Tail, << Acc/binary, (pack(Key))/binary, (pack(Value))/binary>>).
  -
  -% FIXME! this should be without lists:reverse/1
  --spec unpack_map_(binary(), non_neg_integer(), [{term(), msgpack_term()}])->
  -    {more, non_neg_integer()} | { any(), binary()}.
  +    pack_map_(Tail, << Acc/binary, (pack_(Key))/binary, (pack_(Value))/binary>>).
  +
  +% Users SHOULD NOT send too long list: this uses lists:reverse/1
  +-spec unpack_map_(binary(), non_neg_integer(), [{msgpack_term(), msgpack_term()}])->
  +			 {[{msgpack_term(), msgpack_term()}], binary()} | no_return().
   unpack_map_(Bin,  0,  Acc) -> {{lists:reverse(Acc)}, Bin};
  +unpack_map_(<<>>, _,  _ )  -> throw(short);
   unpack_map_(Bin, Len, Acc) ->
  -    case unpack(Bin) of
  -	{more, _} -> {more, undefined};
  -	{Key, Rest} ->
  -	    case unpack(Rest) of
  -		{more, _} -> {more, undefined};
  -		{Value, Rest2} ->
  -		    unpack_map_(Rest2,Len-1,[{Key,Value}|Acc])
  -	    end
  -    end.
  -
  --spec unpack_(Payload::binary()) -> 
  -		     {more, pos_integer()} | {msgpack_term(), binary()} | {error, reason()}.
  -unpack_(Binary)->
  -    case Binary of
  +    {Key, Rest} = unpack_(Bin),
  +    {Value, Rest2} = unpack_(Rest),
  +    unpack_map_(Rest2,Len-1,[{Key,Value}|Acc]).
  +
  +% unpack then all
  +-spec unpack_(Bin::binary()) -> {msgpack_term(), binary()} | {error, reason()} | no_return().
  +unpack_(Bin) when not is_binary(Bin)->
  +    throw(badarg);
  +unpack_(<<>>)->
  +    throw(short);
  +unpack_(Bin) when bit_size(Bin) >= 8 ->
  +    case Bin of
   % ATOMS
   	<<16#C0, Rest/binary>> -> {nil, Rest};
   	<<16#C2, Rest/binary>> -> {false, Rest};
  
positive.code: 	    [Term|unpack_all(Binary)]
      end.
  
  -spec pack_map(M::[{msgpack_term(),msgpack_term()}])-> binary().
  pack_map(M)->
      case length(M) of
  	Len when Len < 16 ->
  
negative.code:     {Term, <<>>}=msgpack:unpack(OrigBin);
  test_p(I,_,OrigBin,Len) when I < Len->
      <<Bin:I/binary, _/binary>> = OrigBin,
      ?assertEqual({error,short}, msgpack:unpack(Bin)).
  
  partial_test()-> % error handling test.
      Term = lists:seq(0, 45),
  