Bring the minimizeMemory() implementation up to date (#193)