Some more memory saving optimizations.