anchor.diff:              NodesMapping = dict:from_list(misc:enumerate(Nodes, 0)),
   
               try
  -                Decoded = ejson:decode(Output),
  -                Map = lists:map(
  -                        fun (Chain) ->
  -                                Length = length(Chain),
  -                                [dict:fetch(N, NodesMapping) || N <- Chain] ++
  -                                    lists:duplicate(NumReplicas - Length + 1, undefined)
  -                        end, Decoded),
  +                Chains0 = ejson:decode(Output),
  +                Chains = lists:map(
  +                           fun (Chain) ->
  +                                 [dict:fetch(N, NodesMapping) || N <- Chain]
  +                           end, Chains0),
  +
  +                EffectiveNumCopies = length(hd(Chains)),
  +
  +                Map0 = simple_minimize_moves(CurrentMap, Chains,
  +                                             EffectiveNumCopies, Nodes),
  +
  +                Map =
  +                    case EffectiveNumCopies < NumReplicas + 1 of
  +                        true ->
  +                            N = NumReplicas + 1 - EffectiveNumCopies,
  +                            Extension = lists:duplicate(N, undefined),
  +                            [Chain ++ Extension || Chain <- Map0];
  +                        false ->
  +                            Map0
  +                    end,
  +
                   {ok, Map}
               catch
                   E:T ->
  
positive.code:         lists:append(
            %% vbmap itself randomizes some things internally so let's give it a
            %% chance
            [[invoke_vbmap(ShuffledNodes, NumVBuckets, NumSlaves, NumReplicas, Tags) ||
                 _ <- lists:seq(1, 3)] ||
                ShuffledNodes <- [misc:shuffle(KeepNodes) || _ <- lists:seq(1, 3)]]),
  
  
negative.code: testnodes(NumNodes) ->
      [list_to_atom([$n | tl(integer_to_list(1000+N))]) || N <- lists:seq(1, NumNodes)].
  
  invoke_vbmap(CurrentMap, Nodes, NumVBuckets, NumSlaves, NumReplicas, Tags) ->
      VbmapName =
          case erlang:system_info(system_architecture) of
              "win32" ->
  