Turned on a whole bunch of compiler warnings, corrected resulting issues.