Tweaks to (hopefully) improve memory usage