Fix for new error handling code