Resolve the exception with the number of sensors store in the
preferences.