Fix assertion failures and other misbehaviors in new auth code.