Fixed a hell of a lot of stuff