Fix duplicate bookmarks and pick up DBID even earlier