Added support for preferences.