Fixed a lot of errors