Fix a few issues detected by static analysis
Merge pull request #580 from HairyFotr/patch-lint

Fix a few issues detected by static analysis