Fixed error when no username and password specified in prefs