Fix some more Coverity issues.
Fix some more coverity issues.
Fix Peter's comment.
Merge pull request #582 from nomis52/master

Fix some more Coverity issues.