Fix for autologin issue

see #153 and #154