Fix crashes due to malformed authentication attempt