Coverity scan fixes

Correct some defects highlighted by Coverity Scan. These changes won't have an impact in OC's performance.

Corrected defects:
* CID 967154
* CID 967156
* CID 1257669
* CID 1257672