anchor.diff:                          [];
                       _ ->
                           Passive1 =
  -                            matching_indexes(
  -                              fun (Ix, [MasterNode | _]) ->
  -                                      case MasterNode =:= node() of
  -                                          true ->
  -                                              VBucketState =
  -                                                  dict:fetch(Ix, VBucketStates),
  -                                              VBucketState =:= active orelse
  -                                                  VBucketState =:= replica orelse
  -                                                  VBucketState =:= pending;
  -                                          false ->
  -                                              false
  -                                      end
  -                              end, FFMap),
  +                            matching_vbuckets(
  +                              fun (_Vb, State) ->
  +                                      State =:= active orelse
  +                                          State =:= replica orelse
  +                                          State =:= pending
  +                              end, FFMap, VBucketStates),
                           Passive1 -- Active
                   end,
   
               [{active, Active},
  -             {passive, Passive}]
  +             {passive, Passive},
  +             {ignore, Ignore}]
       end.
   
   define_group(Bucket, BucketConfig, DDocId, Map) ->
  
positive.code: 
      Active = proplists:get_value(active, NewMap),
      Passive = proplists:get_value(passive, NewMap),
  
      ToRemove =
          case OldMap of
  
negative.code:               end
        end, [], IndexedList).
  
  matching_vbuckets(Pred, Map, States) ->
      matching_indexes(
        fun (Ix, [MasterNode | _]) ->
                case MasterNode =:= node() of
                    true ->
                        VBucketState = dict:fetch(Ix, States),
                        Pred(Ix, VBucketState);
                    false ->
                        false
                end
        end, Map).
  
  build_map(BucketConfig, VBucketStates) ->
      Map = proplists:get_value(map, BucketConfig),
  
      case Map of
          undefined ->
              [{active, []}, {passive, []}, {ignore, []}];
          _ ->
              Active = matching_vbuckets(
                         fun (_Vb, State) ->
                                 State =:= active
                         end, Map, VBucketStates),
  
              Ignore = matching_vbuckets(
                         fun (_Vb, State) ->
                                 State =:= dead
                         end, Map, VBucketStates),
  
              FFMap = proplists:get_value(fastForwardMap, BucketConfig),
              Passive =
  