Some coverity issue fixes
More coverity fixes
Fixing more coverity bugs
More coverity fixes