Fixes to logout/login