Merged from latest version of cocos2d