Fix beginShape.