A few memory optimizations.