Addressed all 5 complains from CoverityScan report

The annoying CoverityScan report is here: https://scan3.coverity.com:8443/reports.htm#v17955/p10516

I am pretty sure that I did not break anything.