Fix promises for openingDb, initDb and preferences