Coverity scan fixes