Fix a problem with error handling.