Fixed some bugs (?)