Fixes from static-analysis tools.

If you like changes like these, I have a bunch more I can do and I'll keep them coming.