[cocos2d] Fix the API issues spotted by the tests