Fixed issues with logout.