a few coverity fixes