Coverity / static analysis based cleanups