Add tests for error reporting.