Fix syntax check, add spec test

I encountered some problems with pull request #37 that broke my puppet runs. I have corrected them in this commit and added a spec test for the syntax check exec as well.