This needs a stronger assertion. Change assertPrefValid to decipher the pref value instead of just comparing it to the stored one and then use it here.