Fixes to authentication.