fixed error handling and commit validation
Merge pull request #137 from assureit/fix_jsonrpc_error

fixed error handling and commit validation