anchor.diff:  strip_metadata(Value) ->
       Value.
   
  -%% strip_metadata(Value) when is_list(Value) ->
  -%%     [X || X <- Value, not (is_tuple(X) andalso
  -%%                            lists:member(element(1, X), [?METADATA_VCLOCK,
  -%%                                                         '_ver']))];
  -%% strip_metadata(Value) ->
  -%%     Value.
  -
  -
  +extract_vclock([{'_vclock', Clock} | _]) -> Clock;
  +extract_vclock(_Value) -> [].
   
   %% Increment the vclock in V2 and replace the one in V1
   increment_vclock(NewValue, OldValue) ->
  -    case is_list(NewValue) of
  -        true ->
  -            OldVClock =
  -                case is_list(OldValue) of
  -                    true ->
  -                        proplists:get_value(?METADATA_VCLOCK, OldValue, []);
  -                    false ->
  -                        []
  -                end,
  -            NewVClock = lists:sort(vclock:increment(node(), OldVClock)),
  -            [{?METADATA_VCLOCK, NewVClock} | lists:keydelete(?METADATA_VCLOCK, 1,
  -                                                             NewValue)];
  -        false ->
  -            NewValue
  -    end.
  +    OldVClock = extract_vclock(OldValue),
  +    NewVClock = lists:sort(vclock:increment(node(), OldVClock)),
  +    [{?METADATA_VCLOCK, NewVClock} | strip_metadata(NewValue)].
   
   %% Set the vclock in NewValue to one that descends from both
   merge_vclocks(NewValue, OldValue) ->
  -    NewValueVClock = proplists:get_value(?METADATA_VCLOCK, NewValue, []),
  -    OldValueVClock = proplists:get_value(?METADATA_VCLOCK, OldValue, []),
  -    NewVClock = lists:sort(vclock:merge([OldValueVClock, NewValueVClock])),
  -    [{?METADATA_VCLOCK, NewVClock} | lists:keydelete(?METADATA_VCLOCK,
  -                                                     1, NewValue)].
  +    NewValueVClock = extract_vclock(NewValue),
  +    OldValueVClock = extract_vclock(OldValue),
  +    case NewValueVClock =:= [] andalso OldValueVClock =:= [] of
  +        true ->
  +            NewValue;
  +        _ ->
  +            NewVClock = lists:sort(vclock:merge([OldValueVClock, NewValueVClock])),
  +            [{?METADATA_VCLOCK, NewVClock} | strip_metadata(NewValue)]
  +    end.
   
   %% gen_server callbacks
   
  
positive.code:                               end),
      ?assertEqual(F, gen_server:call(ns_config, {update_with_changes, F})).
  
  -define(assertConfigEquals(A, B), ?assertEqual(lists:sort(A),
                                                 lists:sort(B))).
  
  test_set() ->
      Self = self(),
  
negative.code: 
      ?assertEqual([[{a, b}, {c, d}], {a, b}, {c, d}], ListValues),
  
      ?assertEqual(-3, strip_metadata(proplists:get_value(a, NewConfig))),
      ?assertEqual(-4, strip_metadata(proplists:get_value(b, NewConfig))),
  
      ?assertMatch([{N, _}] when N =:= node(), extract_vclock(proplists:get_value(a, NewConfig))),
      ?assertMatch([{N, _}] when N =:= node(), extract_vclock(proplists:get_value(b, NewConfig))),
  
      ns_config:update_key(a, fun (3) -> 10 end),
      Updater2 = RecvUpdater(),
      {[{a, [{'_vclock', [_]} | 10]}], NewConfig2} = Updater2(OldConfig),
  
      ?assertConfigEquals([{a, 10} | lists:keydelete(a, 1, OldConfig)], NewConfig2),
      ok.
  