In order to prevent a miscarriage of justice by-reason of defects in pleadings, liberal provision is made for the amendment of pleadings at any stage of the cause.

The most important of these provisions are the following:

"A variance between an allegation and the proof is not material, unless it has actually misled the adverse party to his prejudice in maintaining his action or defense upon the merits. If a party insists that he has been misled, that fact, and the particulars in which he has been misled, must be proved to the satisfaction of the court. Thereupon the court may, in its discretion, order the pleading to be amended, upon such terms as it deems just." 27

"Where the variance is not material, as prescribed in the last section, the court may direct the fact to be found according to the evidence, or may order an immediate amendment without costs." 28

"Where, however, the allegation to which the proof is directed is unproved, not in some particular or particulars only, but in its entire scope and meaning, it is not a case of variance * * * but a failure of proof."29

'The court may, upon the trial, or at any other stage of the action, before or after judgment, in furtherance of justice, and on such terms as it deems just, amend any process, pleading or other proceeding, by adding or striking out the name of a person as a party, or by correcting a mistake in the name of a party, or a mistake in any other respect * * * And in every stage of the action, the court must disregard an error or defect in the pleadings or other proceeding which does not affect the substantial rights of the adverse party." 30

27 N. Y. Code Civ. Pro., Sec. 539;

Cal. Code Civ. Pro., Sec. 469.

28 N. Y. Code Civ. Pro., Sec. 540;

Cal. Code Civ. Pro., Sec. 470. 29 N. Y. Code Civ. Pro., Sec. 541; Cal. Code Civ. Pro., Sec. 471.