anchor.diff:      {Pos, [RevId|_]} = Rev,
       Url = lists:flatten([DbUrl, url_encode(Id), "/", url_encode(?b2l(Name)),
           "?rev=", ?b2l(couch_doc:rev_to_str({Pos,RevId}))]),
  -    ?LOG_DEBUG("Attachment URL ~p", [Url]),
  +    ?LOG_DEBUG("Attachment URL ~s", [Url]),
       {ok, RcvFun} = make_attachment_stub_receiver(Url, Headers, Name, 
           Type, Length),
       {Name, {Type, {RcvFun, Length}}}.
  
positive.code:     
      JsonResults = case length(Revs) > MaxN of
      false ->
          Url = BaseUrl ++ "&open_revs=" ++ lists:flatten(?JSON_ENCODE(Revs)),
          do_http_request(Url, get, Headers);
      true ->
          {_, Rest, Acc} = lists:foldl(
          fun(Rev, {Count, RevsAcc, AccResults}) when Count =:= MaxN ->
              QSRevs = lists:flatten(?JSON_ENCODE(lists:reverse(RevsAcc))),
              Url = BaseUrl ++ "&open_revs=" ++ QSRevs,
              {1, [Rev], AccResults++do_http_request(Url, get, Headers)};
          (Rev, {Count, RevsAcc, AccResults}) ->
              {Count+1, [Rev|RevsAcc], AccResults}
          end, {0, [], []}, Revs),
          Acc ++ do_http_request(BaseUrl ++ "&open_revs=" ++ 
              lists:flatten(?JSON_ENCODE(lists:reverse(Rest))), get, Headers)
      end,
      
      Results =
  
negative.code: do_http_request(Url, Action, Headers, JsonBody) ->
      do_http_request(Url, Action, Headers, JsonBody, 10).
  
  do_http_request(Url, Action, Headers, Body, Retries) when is_binary(Url) ->
      do_http_request(?b2l(Url), Action, Headers, Body, Retries);
  do_http_request(Url, Action, _Headers, _JsonBody, 0) ->
      ?LOG_ERROR("couch_rep HTTP ~p request failed after 10 retries: ~s", 
          [Action, Url]),
      exit({http_request_failed, ?l2b(["failed to replicate ", Url])});
  do_http_request(Url, Action, Headers, JsonBody, Retries) ->
      ?LOG_DEBUG("couch_rep HTTP ~p request: ~s", [Action, Url]),
      Body =
  