More work on preferences.js