UserPreference
Code cleanup, bug fixes