         // an extreme that pushes the bounds.
         var strokeExtents:Rectangle = getStrokeExtents();
         pathBBox.inflate(strokeExtents.right, strokeExtents.bottom);
-
-        if (strokeSettings.joints != "miter" || segments.length < 2)
+		
+		var seg:Vector.<PathSegment> = segments.data;
+
+        if (strokeSettings.joints != "miter" || seg.length < 2)
         {
             // TODO (egeorgie): Will overshoot for "bevel"
             // by the assumed roundness of the joints.

        measuredY = bounds.top;
    }

    /**
     *  @private
     *  @return Returns the axis aligned bounding box of the path resized to width, height and then
     *  transformed with transformation matrix m.
     */
    private function getBoundingBox(width:Number, height:Number, m:Matrix):Rectangle
    {
        var naturalBounds:Rectangle = getBounds();
        var sx:Number = naturalBounds.width == 0 ? 1 : width / naturalBounds.width;
        var sy:Number = naturalBounds.height == 0 ? 1 : height / naturalBounds.height; 

        var prevSegment:PathSegment;
        var pathBBox:Rectangle;
        
        for (var i:int = 0; i < segments.length; i++)
        {
            var segment:PathSegment = segments[i];
            pathBBox = segment.getBoundingBox(prevSegment, sx, sy, m, pathBBox);
            prevSegment = segment;
        }

		// If path is empty, it's untransformed bounding box is (0,0), so we return transformed point (0,0)
        if (!pathBBox)
		{
			var x:Number = m ? m.tx : 0;
			var y:Number = m ? m.ty : 0;
            pathBBox = new Rectangle(x, y);
		}
        return pathBBox;
    }
    
    /**
     *  @private
     *  Storage for the cached bounding box for particular transformation and size.

     *  @playerversion AIR 1.5
     *  @productversion Flex 4
     */ 
	private var segments:PathSegmentsCollection;

    /**
     *  A GraphicsPath object that contains the drawing 
     *  commands to draw this Path.  
