fix a whole bunch of stuff