misc coverity fixes