Removed some memleaks.