Fixes to some Coverity issues.