Another attempt to fix coverity warnings