Fix bounding box computation