Fixes an error with error handling code (doh)