Added negative out-of-bounds check for region rectangles