Fix mem leaks and remove redundant autoreleases