Fix computation of bounding boxes