Don't emit the output file if an error has occurred.  Fixes #12.
Return 1 on failure.  Fixes #3.