Several changes for memory use