Add tests to cover error reporting