Fix a couple of failing tests
Improve a docstring
Add unit tests for new _validate_error() function