Fix some issues reported by Coverity Scan
Merge pull request #3 from cli/master

Merge pull request #2 from cli/master