Fix error reporting in previous commit