Fix Coverity warnings