Simplify use of exec. Return 1 on errors.
Merge pull request #3 from kisielk/master

Simplify code, return 1 on errors.