Fixed minor warning.
Cleanup doAuthentication.