   end
 
   def decode_type(data, :embedded_map, schema) do
-    {keys, rest}   = decode_map_header(data)
-    {keys_and_values, rest} = decode_map_values(rest, keys, schema)
-
-    {Enum.into(keys_and_values, %{}), rest}
+    {keys, rest}  = decode_map_header(data)
+    {pairs, rest} = decode_map_values(rest, keys, schema)
+
+    {Enum.into(pairs, %{}), rest}
   end
 
   def decode_type(<<cluster_id :: 32, position :: 32, rest :: binary>>, :link, _) do


    case decode_header(rest, schema) do
      {field_definitions, rest} ->
        {fields, rest} = decode_fields(rest, field_definitions)

        if class_name == "" do
          class_name = nil


  def decode_type(data, :link_list, _) do
    {nelems, rest} = :small_ints.decode_zigzag_varint(data)
    {elems, rest} = Enum.map_reduce List.duplicate(nil, nelems), rest, fn(_, acc) ->
      decode_type(acc, :link)
    end

