Merge pull request #1120 from dorkster/fixes

Fix a few more Coverity defects