Fixed bug where grid ROI is incorrectly created