Bugfix in login and sessions