Fix coverity warnings