Fized some bugs