varioius coverity fixes