Fix getCoordinates method for Polygon.