Fix login/logout