Coverity fixes

A few issues identified by coverity.
Style.