   end
 
   defp decode_utf8_string(stream, size) do
-    string = Enum.take(stream, size) |> Enum.join()
-    stream = Enum.drop(stream, size)
+    string = stream |> Enum.take(size) |> Enum.join()
+    stream = stream |> Enum.drop(size)
 
     { stream, string }
   end

    { stream, arr }
  end

  defp decode_double(stream, size) do
    { Enum.drop(stream, size), :double }
  end

  defp decode_map(stream, size) do
    decode_map(stream, [], size)
  end

  defp decode_map(stream, map, size) when 0 < size do
    { stream, key } = decode(stream)
    { stream, val } = decode(stream)

    decode_map(stream, map ++ [{ key, val }], size - 1)
  end

  end

  defp decode_uint(stream, size) when 0 < size do
    bytes  = stream |> Enum.take(size) |> Enum.join()
    stream = stream |> Enum.drop(size)

    uint = bitstring_to_list(bytes)
      |> Enum.map(fn(x) -> integer_to_binary(x, 16) end)
      |> Enum.join()
      |> String.to_char_list!()
      |> list_to_integer(16)

    { stream, uint }
  end
