Fixed an issue where an error was thrown after logout

There were a couple points where an error would be thrown after a user logouts, these changes catch those errors.