   end
 
   defp decode_utf8_string(size, data, offset) do
-    { data |> binary_part(offset, size), size + offset }
+    { binary_part(data, offset, size), size + offset }
   end
 end

      |> String.to_char_list()
      |> List.to_integer(16)

    case size do
      2 -> ptr = ptr + 2048
      3 -> ptr = ptr + 526336
      _ -> nil
    end

    { ptr_data, _ } = decode(data, ptr)

                :container, :end_marker, :boolean,     :float ]

  @doc """
  Decodes the datatype found at the given offset of the data.
  """
  @spec decode(binary, integer) :: float | integer | list | map | String.t
  def decode(_data, _offset \\ 0)

  def decode(data, offset) do
    ctrl_code = binary_part(data, offset, 1) |> byte_to_code()
    ctrl_type = Enum.at(@ctrl_types, ctrl_code >>> 5)

    decode_by_type(ctrl_type, ctrl_code, data, 1 + offset)
  end

  defp decode_by_type(:array, ctrl_code, data, offset) do
    { size, offset } = get_meta_size(ctrl_code, data, offset)

    decode_array([], size, data, offset)
  end
  defp decode_by_type(:double, ctrl_code, data, offset) do
    { size, offset } = get_meta_size(ctrl_code, data, offset)

    decode_double(size, data, offset)
  end
  defp decode_by_type(:extended, ctrl_code, data, offset) do
    ext_code  = binary_part(data, offset, 1) |> byte_to_code()
    ctrl_type = Enum.at(@ctrl_types, ext_code + 7)

    decode_by_type(ctrl_type, ctrl_code, data, 1 + offset)
  end
  defp decode_by_type(:float, ctrl_code, data, offset) do
    { size, offset } = get_meta_size(ctrl_code, data, offset)

    decode_float(size, data, offset)
  end
  defp decode_by_type(:map, ctrl_code, data, offset) do
    { size, offset } = get_meta_size(ctrl_code, data, offset)

    decode_map(%{}, size, data, offset)
  end
  defp decode_by_type(:pointer, ctrl_code, data, offset) do
    size   = ((ctrl_code >>> 3) &&& 0x3) + 1
    buffer = binary_part(data, offset, size)

    if 4 > size do
      buffer = <<ctrl_code &&& 0x7>> <> buffer
