Some coverity fixes

Mostly cosmetic changes.