Fix bug with Pref.sort being set to false instead of 0