Fixed a lot issues