Fix inside/out error for ROI