fix computation of rectangle bounding box