anchor.diff:  
   %% Returns true if any value is double (or more) encoded.
   check_double_encoding(EObjs) ->
  -    lists:any(fun(Name) ->
  -                      Name2 = decode_name(Name),
  -                      Name2 /= decode_name(Name2)
  -              end, EObjs).
  +    DL = lists:filter(fun(Name) ->
  +                              Name2 = decode_name(Name),
  +                              Name2 /= decode_name(Name2)
  +                      end, EObjs),
  +    case DL of
  +        [] ->
  +            {false, []};
  +        _ ->
  +            {true, DL}
  +    end.
   
   %% Determine if it is safe to perform migration (no bucket/key conflicts).
   check_safe(RC, EObjs) ->
       EObjs2 = [decode_name(Name) || Name <- EObjs],
  -    MR = RC:mapred(EObjs2, [map_safe(),
  -                            riak_kv_mapreduce:reduce_set_union(true)]),
  +    MR = RC:mapred(EObjs2, [map_unsafe()]),
       case MR of
  -        {ok, [unsafe]} ->
  -            unsafe;
  -        _ ->
  -            safe
  -    end.
  -
  -map_safe() ->
  -    {map, {modfun, ?MODULE, map_safe}, none, false}.
  -map_safe({error, notfound}, _, _) ->
  +        {ok, []} ->
  +            {safe, []};
  +        {ok, Unsafe} ->
  +            {unsafe, Unsafe}
  +    end.
  +
  +map_unsafe() ->
  +    {map, {modfun, ?MODULE, map_unsafe}, none, true}.
  +map_unsafe({error, notfound}, _, _) ->
       [];
  -map_safe(_, _, _) ->
  -    [unsafe].
  +map_unsafe(RO, _, _) ->
  +    [{list_to_binary(mochiweb_util:quote_plus(riak_object:bucket(RO))),
  +      list_to_binary(mochiweb_util:quote_plus(riak_object:key(RO)))}].
   
   %% Perform first phase of migration: copying encoded values to
   %% unencoded equivalents.
   migrate_objects(EObjs) ->
       {ok, RC} = riak:local_client(),
       riak_kv_mapred_cache:clear(),
  -    RC:mapred(EObjs, [map_rewrite_encoded()]),
  -    io:format("All objects with URL encoded buckets/keys have been copied to "
  -              "unencoded equivalents.~n", []).
  +    MR = RC:mapred(EObjs, [map_rewrite_encoded()]),
  +    case MR of
  +        {ok, []} ->
  +            io:format("All objects with URL encoded buckets/keys have been "
  +                      "copied to unencoded equivalents.~n", []),
  +            {ok, []};
  +        {ok, Failed} ->
  +            io:format("Some URL encoded objects failed to copy.~n", []),
  +            {failed, Failed};
  +        _ ->
  +            io:format("There was an error copying objects.~n", []),
  +            error
  +    end.
   
   map_rewrite_encoded() ->
       {map, {modfun, ?MODULE, map_rewrite_encoded}, none, true}.
  
positive.code: %% Perform second phase of migration: delete objects with encoded buckets/keys.
  delete_migrated_objects(EObjs) ->
      {ok, RC} = riak:local_client(),
      [RC:delete(B, K) || {B, K} <- EObjs],
      io:format("All objects with URL encoded buckets/keys have been "
                "deleted.~n", []).
  
  %% @private
  decode_name({B1, K1}) ->
  
negative.code:     case Buckets of
          [] ->
              io:format("Cluster is empty. No migration needed.~n", []),
              {empty, [], []};
          _ ->
              EObjs = get_encoded_keys(RC),
              check_cluster2(RC, EObjs)
      end.
  
  check_cluster2(_, []) ->
      io:format("Cluster does not contain URL encoded values. "
                "No migration needed.~n", []),
      {not_needed, [], []};
  
  check_cluster2(RC, EObjs) ->
      case {check_safe(RC, EObjs), check_double_encoding(EObjs)} of
          {{safe, _}, {false, _}} ->
              io:format("Cluster contains URL encoded values. "
                        "Migration needed.~n", []),
              {needed, EObjs, []};
          {{unsafe, Unsafe}, {false, _}} ->
              io:format("Cluster contains URL encoded values. However, "
                        "custom migration necessary:~n"
                        "  -- Some keys exists in both URL encoded and "
                        "non-encoded form.~n", []),
              {custom, EObjs, Unsafe};
          {{unsafe, Unsafe}, {true, Double}} ->
              io:format("Cluster contains URL encoded values. However, "
                        "custom migration necessary:~n"
                        "  -- Some keys exists in both URL encoded and "
                        "non-encoded form.~n"
                        "  -- Some keys are double URL encoded.~n", []),
              {custom, EObjs, Unsafe ++ Double};
          {{safe, _}, {true, Double}} ->
              io:format("Cluster contains URL encoded values. However, "
                        "custom migration necessary:~n"
                        "  -- Some keys are double URL encoded.~n", []),
              {custom, EObjs, Double}
      end.
  
  %% Returns a list of URL encoded objects needing migration.
  get_encoded_keys() ->
      {ok, RC} = riak:local_client(),
      get_encoded_keys(RC).
  
  get_encoded_keys(RC) ->
      {ok, Buckets} = RC:list_buckets(),
      EObjs = [begin
                   {ok, Objs} = RC:mapred(Bucket, [reduce_check_encoded()]),
  