Fixing login/logout issues.