Fix exit and logout