anchor.diff:                              end, Values)
         end),
   
  -    % set two outdated, locked entries:
  -    Entry1L = db_entry:set_writelock(Entry1, OldVersion - 1),
  -    Entry2L = db_entry:set_writelock(Entry2, OldVersion - 1),
  -    api_dht_raw:unreliable_lookup(db_entry:get_key(Entry1L), {set_key_entry, GSelf, Entry1L}),
  -    api_dht_raw:unreliable_lookup(db_entry:get_key(Entry2L), {set_key_entry, GSelf, Entry2L}),
  -    receive {set_key_entry_reply, Entry1L} -> ok end,
  -    receive {set_key_entry_reply, Entry2L} -> ok end,
  +    % set majority for Deny outdated, locked entries:
  +    [ begin
  +          EntryL = db_entry:set_writelock(X, OldVersion - 1),
  +          api_dht_raw:unreliable_lookup(db_entry:get_key(EntryL), {set_key_entry, GSelf, EntryL}),
  +          receive {set_key_entry_reply, EntryL} -> ok end
  +      end || X <- ModEntries ],
   
       % now try to write
       ?equals_w_note(api_tx:write(Key, 3), {ok}, "write_3_a"),
  
positive.code:     Key = "read_write_2old_a",
      GSelf = comm:make_global(self()),
      ?equals_w_note(api_tx:write(Key, 1), {ok}, "write_1_a"),
      wait_for_dht_entries(config:read(replication_factor)),
      [HK1, HK2, _HK3, _HK4] = ?RT:get_replica_keys(?RT:hash_key(Key)),
      _ = [comm:send_local(DhtNode, {delete_keys, GSelf, [HK1, HK2]}) || DhtNode <- pid_groups:find_all(dht_node)],
      receive {delete_keys_reply} -> ok end,
      receive {delete_keys_reply} -> ok end,
  
      ?equals(api_tx:write(Key, 2), {ok}),
      ok.
  
negative.code:     Key = "read_write_2old_a",
      GSelf = comm:make_global(self()),
      ?equals_w_note(api_tx:write(Key, 1), {ok}, "write_1_a"),
      R = config:read(replication_factor),
      wait_for_dht_entries(R),
      RKeys = ?RT:get_replica_keys(?RT:hash_key(Key)),
      MDeny = quorum:majority_for_deny(R),
      ModKeys = lists:sublist(RKeys, MDeny),
  
      % get ModKeys entries
      ModEntries = [ begin
                      api_dht_raw:unreliable_lookup(X, {get_key_entry, GSelf, X}),
                      receive {get_key_entry_reply, Entry} ->
                              ?assert_w_note(not db_entry:is_empty(Entry), io_lib:format("~p", [Entry])),
                              Entry
                      end
                  end || X <- ModKeys ],
      OldVersion = db_entry:get_version(erlang:hd(ModEntries)),
      %% all entries have same version
      ?assert(lists:all(fun(E) -> db_entry:get_version(E) =:= OldVersion end, ModEntries)),
  
  %%    api_dht_raw:unreliable_lookup(HK1, {get_key_entry, GSelf, HK1}),
  %%    api_dht_raw:unreliable_lookup(HK2, {get_key_entry, GSelf, HK2}),
  %%    receive {get_key_entry_reply, Entry1} ->
  %%                ?assert_w_note(not db_entry:is_empty(Entry1), io_lib:format("~p", [Entry1]))
  %%    end,
  %%    receive {get_key_entry_reply, Entry2} ->
  %%                ?assert_w_note(not db_entry:is_empty(Entry2), io_lib:format("~p", [Entry2]))
  %%    end,
  %%    ?equals(db_entry:get_version(Entry1), db_entry:get_version(Entry2)),
  %%    OldVersion = db_entry:get_version(Entry1),
  
      % write new value
      ?equals_w_note(api_tx:write(Key, 2), {ok}, "write_2_a"),
  