Fixes bugs on cocos2dx 3.x