Coverity fixes

Here's a few trivial changes to silence issues Coverity Scan flagged up.