Fix some coverity build issues