Emit error on non-zero code

This addresses #12 issue.