Fixed some bugs

Bugs still exist!