Fix some coverity issues