Fixed bug in RectangleMethod