Upgraded, fixed some bugs

Weird rare bugs are present