Fixed warnings.

Also added -Wall to Makefile.
Fixed further warnings.

These ones required a few code changes beyond just removing lines.