Misc coverity fixes