Addressed all 5 complains by CoverityScan

CoverityScan report is here: https://scan3.coverity.com:8443/reports.htm#v17955/p10516

The app still runs on Linux