Fixing some Memory leaks [Imemory, DistList]