Fix some more defects.
Fix Peter's comments.
Merge pull request #569 from nomis52/master

Fix some more defects.
Merge branch 'master' of https://github.com/OpenLightingProject/ola into coverity_scan