Some Coverity fixes