Fixed bug in bounding box algorithm.