More tweaks for memory usage