Implement bugfix in http://www.cocos2d-x.org/boards/6/topics/4336?r=15223#message-15223