Fixed some bugs ...