Completed autologin which fixes #8