anchor.diff:  format_subresources([{Key, []} | _]) ->
       ["/", Key].
   
  +%% @doc Format a proplist of query parameters into a string
  +-spec format_query_params(query_params()) -> string().
  +format_query_params([]) ->
  +    [];
  +format_query_params(QueryParams) ->
  +    format_query_params(QueryParams, []).
  +
  +%% @doc Format a proplist of query parameters into a string
  +-spec format_query_params(query_params(), list()) -> string().
  +format_query_params([], QS) ->
  +    ["?", QS];
  +format_query_params([{Key, []} | RestParams], []) ->
  +    format_query_params(RestParams, [Key]);
  +format_query_params([{Key, []} | RestParams], QS) ->
  +    format_query_params(RestParams, [[Key, "&"] | QS]);
  +format_query_params([{Key, Value} | RestParams], []) ->
  +    format_query_params(RestParams, [Key, "=", Value]);
  +format_query_params([{Key, Value} | RestParams], QS) ->
  +    format_query_params(RestParams, [[Key, "=", Value, "&"] | QS]).
  +
   %% @doc Parse the valid subresources from the raw path.
  --spec get_subresources(string()) -> subresources().
  +-spec get_subresources(string()) -> {subresources(), query_params()}.
   get_subresources(QueryString) ->
  -    lists:filter(fun valid_subresource/1, mochiweb_util:parse_qs(QueryString)).
  +    lists:partition(fun valid_subresource/1, mochiweb_util:parse_qs(QueryString)).
   
   %% @doc Determine if a query parameter key is a valid S3 subresource
   -spec valid_subresource(subresource()) -> boolean().
  
positive.code: -endif.
  
  -type subresource() :: {string(), string()}.
  -type subresources() :: [subresource()].
  
  %% @doc Function to rewrite headers prior to processing by webmachine.
  
negative.code: rewrite_path(Method, "/", [], Bucket) when Method =/= 'GET' ->
      lists:flatten(["/buckets/", Bucket]);
  rewrite_path(_Method, "/", QS, Bucket) ->
      {SubResources, QueryParams} = get_subresources(QS),
      lists:flatten(["/buckets/", Bucket, format_bucket_qs(QueryParams, SubResources)]);
  rewrite_path(_Method, Path, QS, Bucket) ->
      lists:flatten(["/buckets/",
                     Bucket,
  