Corrected issues with handling errors related to out of date credentials and logout.