Port of changes to primitives class BoundingBox.