Fixed getBoundingRectangle method