Fixed a potential problem in the error handling.

Apple should remember something like this 😁