Remove several uses of freed memory