Fixed a lot of stupidity