Fix the logout code (I think)