Added LegacyUsername to sync and authentication.
Fixed legacy username logon.
Ignored DB errors.