Extract error handler, improve test coverage.
Bump version up to v0.1.3-pre .