Issue 1640 - Login preference strings and username check

As discussed, changed login strings and check for username instead of hkey.