anchor.diff:                               end, lists:reverse(Data)),
       UpdateElement = util:randomelem(UniqueData),
       Old = ?TEST_DB:get_entry2(DB2, db_entry:get_key(UpdateElement)),
  -    DB3 = ?TEST_DB:record_changes(DB2, ChangesInterval),
  -    
       UpdatedElement = db_entry:inc_version(db_entry:set_value(UpdateElement, UpdateVal)),
  -    DB4 = ?TEST_DB:update_entry(DB3, UpdatedElement),
  -    check_changes(DB4, ChangesInterval, "changed_update_entry_1"),
  -    check_entry_in_changes(DB4, ChangesInterval, UpdatedElement, Old, "changed_update_entry_2"),
  -    
  -    DB5 = check_stop_record_changes(DB4, ChangesInterval, "changed_update_entry_3"),
  +    
  +    case element(1, Old) of
  +        false -> % element does not exist, i.e. was a null entry, -> cannot update
  +            DB5 = DB2;
  +        _ ->
  +            DB3 = ?TEST_DB:record_changes(DB2, ChangesInterval),
  +            DB4 = ?TEST_DB:update_entry(DB3, UpdatedElement),
  +            check_changes(DB4, ChangesInterval, "changed_update_entry_1"),
  +            check_entry_in_changes(DB4, ChangesInterval, UpdatedElement, Old, "changed_update_entry_2"),
  +            
  +            DB5 = check_stop_record_changes(DB4, ChangesInterval, "changed_update_entry_3")
  +    end,
   
       ?TEST_DB:close(DB5),
       true.
  
positive.code:         Keys::[{?RT:key(), OldExists::boolean()}], Note::string()) -> true.
  check_keys_in_deleted(DB, ChangesInterval, Keys, Note) ->
      {_ChangedEntries, DeletedKeys} = ?TEST_DB:get_changes(DB),
      [begin
           case intervals:in(Key, ChangesInterval) andalso OldExists of
               true ->
                   case length([K || K <- DeletedKeys, K =:= Key]) of
                       1 -> ok;
                       _ -> ?ct_fail("element(2, ?TEST_DB:get_changes(DB)) evaluated "
                                     "to \"~w\" and did not contain 1x key ~w~n(~s)~n",
                                     [DeletedKeys, Key, lists:flatten(Note)])
                   end;
               _    -> true
           end
       end || {Key, OldExists} <- Keys],
      true.
  
  %% @doc Checks that an entry is present exactly once in the list of changed
  %%      entries returned by ?TEST_DB:get_changes/1.
  -spec check_entry_in_changes(
          DB::?TEST_DB:db(), ChangesInterval::intervals:interval(), Entry::db_entry:entry(),
          {OldExists::boolean(), OldEntry::db_entry:entry()}, Note::string()) -> ok.
  check_entry_in_changes(DB, ChangesInterval, NewEntry, {_OldExists, OldEntry}, Note) ->
      case intervals:in(db_entry:get_key(NewEntry), ChangesInterval) andalso 
               OldEntry =/= NewEntry of
          true ->
              {ChangedEntries, _DeletedKeys} = ?TEST_DB:get_changes(DB),
              case length([E || E <- ChangedEntries, E =:= NewEntry]) of
                  1 -> ok;
                  _ -> ?ct_fail("~s evaluated to \"~w\" and did not contain 1x entry ~w~n(~s)~n",
  
negative.code:     ?equals_w_note(?TEST_DB:get_changes(DB9), {[], []}, "stop_record_changes_11"),
  
      ?TEST_DB:close(DB9),
      true.
  
  tester_changed_keys_get_entry(_Config) ->
      tester:test(?MODULE, prop_changed_keys_get_entry, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_set_entry(_Config) ->
      tester:test(?MODULE, prop_changed_keys_set_entry, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_update_entry(_Config) ->
      tester:test(?MODULE, prop_changed_keys_update_entry, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_delete_entry(_Config) ->
      tester:test(?MODULE, prop_changed_keys_delete_entry, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_read(_Config) ->
      tester:test(?MODULE, prop_changed_keys_read, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_write(_Config) ->
      tester:test(?MODULE, prop_changed_keys_write, 5, rw_suite_runs(1000)).
  
  tester_changed_keys_delete(_Config) ->
      tester:test(?MODULE, prop_changed_keys_delete, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_get_entries2(_Config) ->
      tester:test(?MODULE, prop_changed_keys_get_entries2, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_get_entries4(_Config) ->
      tester:test(?MODULE, prop_changed_keys_get_entries4, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_update_entries(_Config) ->
      tester:test(?MODULE, prop_changed_keys_update_entries, 4, rw_suite_runs(1000)).
  
  tester_changed_keys_delete_entries1(_Config) ->
      tester:test(?MODULE, prop_changed_keys_delete_entries1, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_delete_entries2(_Config) ->
      tester:test(?MODULE, prop_changed_keys_delete_entries2, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_get_load(_Config) ->
      tester:test(?MODULE, prop_changed_keys_get_load, 2, rw_suite_runs(1000)).
  
  tester_changed_keys_get_load2(_Config) ->
      tester:test(?MODULE, prop_changed_keys_get_load2, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_split_data1(_Config) ->
      tester:test(?MODULE, prop_changed_keys_split_data1, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_split_data2(_Config) ->
      tester:test(?MODULE, prop_changed_keys_split_data2, 3, rw_suite_runs(1000)).
  
  tester_changed_keys_get_data(_Config) ->
      tester:test(?MODULE, prop_changed_keys_get_data, 2, rw_suite_runs(1000)).
  
  tester_changed_keys_add_data(_Config) ->
      tester:test(?MODULE, prop_changed_keys_add_data, 2, rw_suite_runs(1000)).
  
  tester_changed_keys_check_db(_Config) ->
      tester:test(?MODULE, prop_changed_keys_check_db, 2, rw_suite_runs(1000)).
  
  tester_changed_keys_mult_interval(_Config) ->
      tester:test(?MODULE, prop_changed_keys_mult_interval, 5, rw_suite_runs(1000)).
  
  tester_stop_record_changes(_Config) ->
      tester:test(?MODULE, prop_stop_record_changes, 5, rw_suite_runs(1000)).
  
  
  % helper functions:
  
  -spec check_entry(DB::?TEST_DB:db(), Key::?RT:key(), ExpDBEntry::db_entry:entry(),
                    ExpRead::{ok, Value::?TEST_DB:value(), Version::?TEST_DB:version()} | {ok, empty_val, -1},
                    ExpExists::boolean(), Note::string()) -> true.
  check_entry(DB, Key, ExpDBEntry, ExpRead, ExpExists, Note) ->
      ?equals_w_note(?TEST_DB:get_entry2(DB, Key), {ExpExists, ExpDBEntry}, Note),
      ?equals_w_note(?TEST_DB:get_entry(DB, Key), ExpDBEntry, Note),
      ?equals_w_note(?TEST_DB:read(DB, Key), ExpRead, Note),
      true.
  
  % note: use manageable values for ReadLock!
  -spec create_db_entry(Key::?RT:key(), Value::?DB:value(), WriteLock::boolean(),
                        ReadLock::0..1000, Version::?DB:version() | -1) -> db_entry:entry().
  create_db_entry(Key, Value, WriteLock, ReadLock, Version) ->
      E1 = db_entry:new(Key, Value, Version),
      E2 = case WriteLock of
               true -> db_entry:set_writelock(E1);
               _    -> E1
           end,
      _E3 = inc_readlock(E2, ReadLock).
  
  -spec inc_readlock(DBEntry::db_entry:entry(), Count::non_neg_integer()) -> db_entry:entry().
  inc_readlock(DBEntry, 0) -> DBEntry;
  inc_readlock(DBEntry, Count) -> inc_readlock(db_entry:inc_readlock(DBEntry), Count - 1).
  
  -spec check_db(DB::?TEST_DB:db(),
                 ExpCheckDB::{true, []} | {false, InvalidEntries::?TEST_DB:db_as_list()},
                 ExpLoad::integer(),
                 ExpData::?TEST_DB:db_as_list(), Note::string()) -> true.
  check_db(DB, ExpCheckDB, ExpLoad, ExpData, Note) ->
      check_db(DB, ExpCheckDB, ExpLoad, ExpData, {[], []}, Note).
  
  -spec check_db(DB::?TEST_DB:db(),
                 ExpCheckDB::{true, []} | {false, InvalidEntries::?TEST_DB:db_as_list()},
                 ExpLoad::integer(),
                 ExpData::?TEST_DB:db_as_list(),
                 ExpCKData::{UpdatedEntries::?TEST_DB:db_as_list(), DeletedKeys::[?RT:key()]},
                 Note::string()) -> true.
  check_db(DB, ExpCheckDB, ExpLoad, ExpData, ExpCKData, Note) ->
      ?equals_w_note(?TEST_DB:check_db(DB), ExpCheckDB, Note),
      ?equals_w_note(?TEST_DB:get_load(DB), ExpLoad, Note),
      ?equals_w_note(lists:sort(?TEST_DB:get_data(DB)), lists:sort(ExpData), Note),
      ?equals_w_note(?TEST_DB:get_changes(DB), ExpCKData, Note),
      true.
  
  %% @doc Like check_db/5 but do not check DB using ?TEST_DB:check_db.
  -spec check_db2(DB::?TEST_DB:db(), ExpLoad::integer(),
                 ExpData::?TEST_DB:db_as_list(), Note::string()) -> true.
  check_db2(DB, ExpLoad, ExpData, Note) ->
      check_db2(DB, ExpLoad, ExpData, {[], []}, Note).
  
  %% @doc Like check_db/5 but do not check DB using ?TEST_DB:check_db.
  -spec check_db2(DB::?TEST_DB:db(), ExpLoad::integer(),
                  ExpData::?TEST_DB:db_as_list(),
                  ExpCKData::{UpdatedEntries::?TEST_DB:db_as_list(), DeletedKeys::[?RT:key()]},
                  Note::string()) -> true.
  check_db2(DB, ExpLoad, ExpData, ExpCKData, Note) ->
      ?equals_w_note(?TEST_DB:get_load(DB), ExpLoad, Note),
      ?equals_w_note(lists:sort(?TEST_DB:get_data(DB)), lists:sort(ExpData), Note),
      ?equals_w_note(?TEST_DB:get_changes(DB), ExpCKData, Note),
      true.
  
  get_random_interval_from_changes(DB) ->
  