[FIX] Fixed some bugs