Fix some more things picked up by static analysis.