Fixed error in automatic bounding box algorithm.