Fixed a few Coverity Scan issues