Check errors explicitly; don't rely on assert().
Merge pull request #82 from kdienes/check-errors

Check errors explicitly; don't rely on assert().