Coverit

Some small minor fixes for issues found with Coverity.