Fixed some bugs for JSB