Made compatible with cocos2d 2.0.