Build fixes for newer versions of gcc, and some minor cleanups.

Here are 3 tiny patches, the first fixes the build on my system, the next two fix up two minor issues found by checkpatch.pl and sparse.