small changes to avoiding 'freeing unused memory...'