Bugfix for missing global ref of current database.