Make _calcBounds more flexible