Add check for errors

Fixes #3.
1.0.1