Fixed logout/login workflow issues.