fix some coverity errors