Implement readPreferences
Fix constant generator & regenerate