Fixed some bugs......