Help the cherry-pick for a bunch of coverity fixes.