Fix error and failure reporting.