Untested changes to limit memory useage.