Bug fixes related to logout.