Fix default db selection if there is no db