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:     ?equals_w_note(?TEST_DB:get_changes(DB9), {[], []}, "stop_record_changes_11"),
  
      ?TEST_DB:close(DB9),
      true.
  
  get_random_interval_from_changes(DB) ->
  
negative.code:     DBEntry2 = create_db_entry(db_entry:get_key(DBEntry1), Value2, WriteLock2, ReadLock2, Version2),
      DB = ?TEST_DB:new(),
      DB2 = ?TEST_DB:set_entry(DB, DBEntry1),
      case db_entry:is_null(DBEntry1) of
          true -> % update not possible
              DB3 = DB2,
              ok; 
          false ->
              DB3 = ?TEST_DB:update_entry(DB2, DBEntry2),
              IsNullEntry = db_entry:is_null(DBEntry2),
              check_entry(DB3, db_entry:get_key(DBEntry2), DBEntry2,
                          {ok, db_entry:get_value(DBEntry2), db_entry:get_version(DBEntry2)},
                          not IsNullEntry, "check_entry_update_entry_1"),
              case not db_entry:is_empty(DBEntry2) andalso
                       not (db_entry:get_writelock(DBEntry2) andalso db_entry:get_readlock(DBEntry2) > 0) andalso
                       db_entry:get_version(DBEntry2) >= 0 of
                  true -> check_db(DB3, {true, []}, 1, [DBEntry2], "check_db_update_entry_0");
                  _ when IsNullEntry ->
                      check_db(DB3, {true, []}, 0, [], "check_db_update_entry_1");
                  _    -> check_db(DB3, {false, [DBEntry2]}, 1, [DBEntry2], "check_db_update_entry_2")
              end
      end,
      ?TEST_DB:close(DB3),
      true.
  