Fixed SOME bugs