Fixed login/logout