Fix bug with logout.