Fixed up a whole lot of errors