Removed some mem_copies that were leaking