Preferences window ready to display, fix in db.sql