Added margin parameter to BoundingBox.