Re-implemented RegionToRegionRectangleConnect to fix remainder problem