Logout and minor bug