Coverity fixes.

Also still trying to figure out why that test is failing.