Fix error reporting