Memory leaks

@azirbel @addepar-andy