   # Page
   defp decode_result_response(<<0x0002::32-signed>> <> buffer, query) do
     page = new_page(query)
-    {page, buffer} = decode_metadata(page, buffer)
+    {page, buffer} = decode_metadata(buffer, page)
     content = decode_page_content(buffer, page.columns)
     %{page | content: content}
   end

  # Prepared
  defp decode_result_response(<<0x0004::32-signed>> <> buffer, %Prepared{} = prepared) do
    {id, buffer} = decode_string(buffer)
    {%{columns: bound_columns}, buffer} = decode_metadata(%Page{}, buffer)
    {%{columns: result_columns}, <<>>} = decode_metadata(%Page{}, buffer)
    %{prepared | id: id, bound_columns: bound_columns, result_columns: result_columns}
  end


    %{keyspace: keyspace, subject: subject}
  end

  defp decode_metadata(<<flags::4-bytes, column_count::32-signed>> <> buffer, page) do
    <<_::29, no_metadata::1, has_more_pages::1, global_table_spec::1>> = flags
    {page, buffer} = decode_paging_state(buffer, page, has_more_pages)

    cond do
      no_metadata == 1 ->
