Fix error reporting.

Fixes #129.