Fix a whole bunch of warnings