Fixed some bugs and changed something.