Fixed a lot of small issues