Some coverity fixes

Please review