Various changes for keeping ScheduledAgent within memory caps