Fixes bugs related to authentication.