Fixed a few buggs nearly works