Fixes error reporting