fix a whole bunch of mistakes