Small code improvement.
Improve ROI saving to only save ROIs when they actually have changed.