Fixed some memory leaks without ARC and tested without ARC.