Made a lot of fixes