Now correctly handles database preferences from dialog box.