Fixed a whole bunch of errors