Fixed a bunch of mistakes