Crash fix in cocos2d.