Patches to error handling.