Made UpdateBoundingBox more intelligent.