Login/logout fixes.