Fixed memory leaks in some cocos stuff