I have no clue why it is working now :S

Also fixed some other bugs