Fixed some bugs caused by typos