Fixed login/logout bug.