Coverity fixes

Fixes a couple of small issues found by Coverity Scan.