Fiexed some bugs