Fix coverity issues