Fix a few things about which Coverity complained.

I mentioned this in #1956.