
94 Cal.App.3d 823 (1979)
156 Cal. Rptr. 673
L.D. BABCOCK et al., Plaintiffs and Respondents,
v.
JOY ANTIS, Defendant and Appellant. EDNA W. SHARPE, Plaintiff and Respondent,
v.
WILLIAM CURTISS et al., Defendants and Appellants. JULIUS S. GRUSH, Plaintiff and Appellant,
v.
EDWARD HIGGINS et al., Defendants and Respondents. INDIAN HILL INVESTMENT COMPANY, Plaintiff and Respondent,
v.
CUSTOM POOLS BY MARK TWAIN et al., Defendants and Appellants.
Docket No. 55953.
Court of Appeals of California, Second District, Division Two.
July 6, 1979.
*826 COUNSEL
Weisman & Grush and John David Fischer for Plaintiff and Appellant.
Lawson M. Brown, Wilfred J. Bedworth, Robert L. Risley and John R. Lambert for Defendants and Appellants.
Paul L. Riles, Judith A. Kaluzny and Cerini C. Bess for Plaintiffs and Respondents.
Edward Higgins, in pro. per., for Defendants and Respondents.
OPINION
FLEMING, Acting P.J.
The Appellate Department of the Los Angeles Superior Court reversed the judgments in four consolidated municipal court actions for lack of subject-matter jurisdiction, in that the amount of damages demanded in the complaints potentially exceeded the $5,000 jurisdictional limit of the municipal court (Code Civ. Proc., § 86). Under rule 62 [Cal. Rules of Court] we transferred these causes to this court for hearing.
Three of the four consolidated appeals involve actions for unlawful detainer and damages. A judgment for possession was entered in each cause, and damages were awarded in the following amounts:


  Babcock v. Antis                                           $560
  Sharpe v. Curtiss                         $3,651.38 damages and
                                            $350 attorneys' fees.
  Indian Hills Investment v.                $3,130.58 damages and
    Custom Pools                          $1,200 attorneys' fees.

*827 Although the amount of these judgments did not exceed the municipal court limit of $5,000, the appellate department reversed each judgment because the complainants' pleadings failed to specify a limit of $5,000 on potential recovery, a failure which in the court's view made the judgments void for lack of subject-matter jurisdiction. None of the complaints specifically enumerated damages in an amount over $5,000, but each complaint contained the potential for exceeding $5,000 by reason of demands for uncalculated, contingent, future claims. As an example of such claims, the complaint in Babcock requested damages of $15 for each day of unlawful detention; the complaint in Sharpe requested damages of $11.67 for each day of unlawful detention; and the complaint in Indian Hills requested damages of $10.30 for each day of unlawful detention. Thus 334 days of holdover in Babcock  if it should occur  could increase the damage claim for unlawful detention to an amount above $5,000.
The fourth cause on appeal, Grush v. Higgins, was an action on a note which sought recovery of $5,000 and reasonable attorneys' fees. At trial, the municipal court gave judgment on the merits for defendants. The appellate department reversed, on the ground that because the complaint sought damages in excess of $5,000, the municipal court lacked subject-matter jurisdiction of the cause.
The appellate department reasoned that each of these judgments was invalid for lack of subject-matter jurisdiction in that the complaint in each cause sought relief which could potentially exceed the $5,000 jurisdictional limit of the municipal court. In the appellate department's view, the mere existence in the pleadings of a potential demand for damages in excess of $5,000, even though the amount was not specified or enumerated, deprived the municipal court of jurisdiction to adjudicate these causes. Accordingly, the appellate department concluded that the judgments in the municipal court were nullities and directed a transfer of these causes to the superior court.
We brought these causes here to consider whether an unenumerated demand in a complaint for damages which could potentially exceed the statutory limits of the municipal court automatically deprives that court of jurisdiction to hear and determine the cause.


*828 I
The basic issue is the proper pleading of the jurisdiction of the municipal court. (1) We start with the proposition that liberal construction of pleadings is the rule and technical and restrictive interpretations of pleadings are the exception. (Code Civ. Proc., § 452.) A persuasive argument can be made that when a litigant files an action in a particular court he intends to submit himself to the jurisdictional limits of that court, and that this intention should be availed of to construe his pleadings as falling within the jurisdiction of the court. We think it can be readily inferred that a litigant who files suit in a municipal court does not expect damages in excess of $5,000, and that, absent any specific enumerated demand for an amount in excess of $5,000, his pleadings should be construed as seeking the relief which it is within the jurisdiction of the court to give.
But this common sense view of pleading must be reconciled with Code of Civil Procedure section 396, which provides in part: "If an action or proceeding is commenced in a court which lacks jurisdiction of the subject matter thereof, as determined by the complaint or petition ... the action or proceeding shall not be dismissed ... but shall ... be transferred to a court having jurisdiction of the subject matter...." (Italics added.) (2) Under this section the initial jurisdiction of a court is "determined by the complaint or petition." Most of the time this provision is used to confer jurisdiction, as when a trifling claim in the superior court is accompanied by a demand for large damages. If the demand is for a sum above the superior court minimum, the provision is used to justify superior court jurisdiction. (Sellery v. Ward (1942) 21 Cal.2d 300, 304-305 [131 P.2d 550]; Schwartz v. Cal. Claim Service (1942) 52 Cal. App.2d 47, 56 [125 P.2d 883]; Todhunter v. Smith (1934) 219 Cal. 690, 694 [28 P.2d 916].) Even if the amount of the claim ultimately falls below the jurisdictional minimum, and even if the final judgment is less than the jurisdictional minimum, the superior court retains jurisdiction to hear and adjudicate the cause. (Sellery v. Ward, supra, 21 Cal.2d 300, 304-305.)
Other provisions of section 396 are likewise relevant. One provides for remission of excess: "In any case where the lack of jurisdiction is due solely to an excess in the amount of the demand, the excess may be remitted and the action may continue in the court where it is pending." (Italics added.) Careful practitioners in the municipal courts automatically plead a clause of this sort to preclude divestiture by reason of excess *829 demand. One or two cases have suggested that in the absence of specified pleading, remission of an excess amount of demand will not be inferred. (Williams v. Rosinsky Motor Co. (1955) 133 Cal. App.2d Supp. 798, 803 [284 P.2d 979].)
Section 396 further provides: "Nothing herein shall be construed to preclude or affect the right to amend the pleadings as provided in this code." (Italics added.)
Finally, section 396 authorizes transfer of causes between courts by reason of events taking place after the filing of the complaint. "If an action or proceeding is commenced in or transferred to a court which has jurisdiction of the subject matter thereof as determined by the complaint or petition, and it thereafter appears from the verified pleadings, or at the trial, or hearing, that the determination of the action or proceeding, or of a cross-complaint, will necessarily involve the determination of questions not within the jurisdiction of the court ... the court, whenever such lack of jurisdiction appears, must suspend all further proceedings therein and transfer the action or proceeding ... to a court having jurisdiction...." (Italics added.)
These various provisions make it clear that section 396 is designed to support jurisdiction and not to defeat it, to aid a litigant by channeling his cause into the proper court and keeping it there unless that court loses jurisdiction by reason of some later event. Excess demands may be remitted, pleadings amended, and causes transferred  all with the view of furthering litigation and minimizing technical traps for the unwary. The text of section 396, therefore, readily harmonizes with the rule of liberal construction of pleadings.

II
(3a) We think the judgments in the three unlawful detainer actions came within the jurisdiction of the municipal court for two reasons: (1) potential loss of jurisdiction never materialized; (2) pleadings may be amended after judgment to conform to proof.
(4a) 1. The second paragraph of section 396 foresees the possibility of initial municipal court jurisdiction, which is later lost because of subsequent events. Under this paragraph a municipal court retains jurisdiction until it appears to lose it by proliferation of issues, by cross-complaint, or by an increased amount of damages. Only on the *830 apparent happening of one of these events does the court lose jurisdiction. For example, if in Babcock 334 days had passed, the rental claim had risen above $5,000, and the excess had not been remitted, the municipal court would lose jurisdiction over the cause. (3b) We think loss of municipal court jurisdiction in unlawful detainer causes does not arise with potential excess of damages but only with apparent excess of damages, in that every unlawful detainer action possesses the potential for damages above $5,000 by reason of protracted holdover, but relatively few of them reach the stage of apparent excess. In causes of this sort initial municipal court jurisdiction attaches and continues until lost by subsequent events. At bench, the potential damage claims in excess of municipal court jurisdiction never materialized, and the municipal court never lost jurisdiction as a result of subsequent events.
(4b) 2. Section 396, by adopting the provisions of the Code of Civil Procedure which relate to amendment of pleadings, preserves a litigant's right to amend and correct pleadings. These amendatory provisions include sections 469 and 470, which permit amendment of pleadings to conform to proof; section 473, which permits correction of mistakes in pleadings; and section 1173, which permits amendment of pleadings in unlawful detainer actions to conform to proof. Under the authority of these sections pleadings may be amended to conform to proof, and mistakes may be corrected before or after judgment. Defects in a plaintiff's pleading of unlawful detainer, if such in fact exist, are therefore correctable. (See Skaff v. Small Claims Court (1968) 68 Cal.2d 76, 77 [65 Cal. Rptr. 65, 435 P.2d 825].) Because mistakes in pleadings may be corrected at any time (Code Civ. Proc., § 473), we think pleadings technically vulnerable to a construction that might defeat the court's jurisdiction after entry of judgment, such as the construction asserted here, may likewise be corrected after judgment, particularly when correction is designed to carry out the obvious intention of the litigant at the time he filed his action. (3c) We therefore conclude that a mere demand for daily damages or for other generalized damages in unenumerated amounts, which could be interpreted as potentially escalating the amount of the demand above the municipal court's jurisdiction, is correctable by amendment to conform to proof.
Unfortunately, it escaped the attention of court and counsel in the trial court that the pleadings were technically vulnerable to a construction that they contained the potential for exceeding the jurisdictional limit of the municipal court. It would, of course, have been preferable if before judgment the trial court had amended the pleadings to conform to proof *831 or had ordered plaintiffs to file remittiturs of any excess in the potential demand for damages. However, we do not believe this failure to amend to conform to proof defeated the jurisdiction of the municipal court. This court likewise has the power to correct technical mistakes in pleadings not affecting the substantial rights of the parties (Code Civ. Proc., §§ 43, 473, 475, 906; cf. Shelby v. Houston (1869) 38 Cal. 410, 420.) Indeed, the Constitution impels us to do so (Cal. Const., art. VI, § 13) by commanding that: "No judgment shall be set aside, or new trial granted, in any cause, ... for any error as to any matter of pleading, or for any error as to any matter of procedure, unless, after an examination of the entire cause, including the evidence, the court shall be of the opinion that the error complained of has resulted in a miscarriage of justice."
We, therefore, direct the clerk of this court to insert in the prayer of each of the complaints for unlawful detainer the phrase, "not in excess of a total amount of $5,000."

III
The fourth cause is an action on a note, with a demand for $5,000, for reasonable attorneys' fees, and for costs. The parties went to trial on the merits, plaintiff lost, judgment was entered for defendants, and plaintiff appealed. The appellate department interpreted the complaint's demand for reasonable attorneys' fees as a substantive demand for damages, which, when added to the demand for $5,000 as principal due on the note, pleaded a demand in excess of the $5,000 jurisdictional limit of the municipal court. Accordingly, on the ground that plaintiff's pleadings were judicially defective, the appellate department reversed a judgment on the merits for defendants and ordered a new trial in the superior court.
(5) We think the technical deficiencies in plaintiff's pleadings provided insufficient cause to grant plaintiff a new trial for four reasons: (1) A demand for reasonable attorneys' fees authorized by contract may be treated as a demand for costs. (2) At bench, plaintiff's demand can be construed as one within the $5,000 limitation. (3) Plaintiff, having lost on the merits, is estopped from obtaining a reversal of the judgment on the ground of potential defects in his own pleadings. (4) Any new trial would now take place in the municipal court.
1. In Beneficial Standard Properties Inc. v. Scharps (1977) 67 Cal. App.3d 227 [136 Cal. Rptr. 549], the court ruled that attorneys' fees authorized by contract may be recovered as part of costs. We do not *832 repeat the legal discussion in that cause, with which we agree, but merely note that under this ruling reasonable attorneys' fees, like interest, may be treated as part of costs and hence can fall outside the substantive demand of the complaint. Accordingly, a demand for reasonable attorneys' fees may be deemed a demand for costs, which need not affect the jurisdictional limits of a court. Under this view the demand in the complaint for reasonable attorneys' fees became a superfluous pleading (see Beneficial Standard Properties, Inc., supra, at p. 232), whose sole function was to put the opposing party on notice that such a claim would eventually be made as part of costs. Since it was an unnecessary pleading, it can be disregarded for jurisdictional purposes.
2. The demand for reasonable attorneys' fees can also be construed as a contingent demand, to become effective only in the event the court should determine that something less than the full $5,000 claimed as principal was owed. For example, if the court determined that only $4,000 was due on the note, the demand for reasonable attorneys' fees, even if treated as a substantive demand, would not necessarily exceed the jurisdictional limit of the court. (Cf. Allstate Leasing Corp. v. Smith (1965) 238 Cal. App.2d 128, 131 [47 Cal. Rptr. 636].)
3. In this cause plaintiff brought his case to trial on the merits and lost. Clearly, he is estopped from obtaining a new trial by reason of the potential deficiencies and ambiguities contained in his own pleadings. (Allstate Leasing Corp. v. Smith, supra, 238 Cal. App.2d 128; Bartnett v. Hull (1912) 19 Cal. App. 91 [124 P. 885].) As this court said in Allstate Leasing Corp. v. Smith, supra, at page 132: "Since the jurisdictional attack was not mounted until after final judgment, for purposes of determining the jurisdictional amount we can properly construe a demand for the contract balance, plus reasonable attorney's fees, as a demand in excess of the $5,000 jurisdictional amount. (De Jarnatt v. Marquez, 132 Cal. 700 [64 P. 1090].) Had respondents at the time of trial attacked the pleading of reasonable attorney's fees as an insufficient allegation of the jurisdictional amount by either a general demurrer, a special demurrer for uncertainty, a motion for a bill of particulars, a motion to dismiss, or a motion for summary judgment, Allstate would have had an opportunity to amend its complaint to specify a demand for attorney's fees which, when added to the amount due under the lease, would amount to a specific sum in excess of $5,000, or to transfer the cause to the municipal court in advance of trial. Since no such challenge was made, since all intendments favor a judgment, and since a demand for reasonable attorney's fees under contract is susceptible to broad interpretation, we give it that broad *833 interpretation and construe the demand as one within the jurisdiction of the superior court."
A comparable situation was noted in De Jarnatt v. Marquez (1901) 132 Cal. 700, at page 701 [64 P. 1090], where the court commented unfavorably on a litigant's jurisdictional objections raised after he had tried the cause on its merits and lost: "He made no protest or objection going to the jurisdiction of that court to try the case upon its merits, and without raising any question of law whatever in that court, he goes to trial, and then, having lost his case, for the first time he here denies the jurisdiction of the superior court to hear and determine the cause. It may at least be said that in the orderly course of civil procedure he should have raised this jurisdictional question in the court where the case was upon trial."
A similar situation arose in Bartnett v. Hull (1912) 19 Cal. App. 91, at page 94 [124 P. 885], where the court likewise rejected an attempt to reverse a judgment for lack of subject-matter jurisdiction. "Where, as in this case, a pleading is perhaps ambiguous and uncertain, or susceptible of two interpretations as to its meaning, and all parties to the action apparently adopt and acquiesce in an interpretation that sustains the jurisdiction of the court as to the subject matter of the action, the losing party in such court should not be allowed upon appeal for the first time to insist upon a different interpretation of the pleading  one that will oust the court of its jurisdiction. If the uncertainty in the complaint had been pointed out in the justice court, it could have been readily amended so as to have certainly corrected the defect and placed the question of jurisdiction beyond cavil."
We see no good reason to retry the cause at bench and give plaintiff another chance to obtain a favorable judgment merely because he pleaded a demand susceptible to a construction that it exceeded the judicial limit of the court. Having litigated on the merits, plaintiff is estopped from taking advantage of a technical mistake of his own creation.
4. Finally, we note that as of July 1, 1979, the jurisdiction of the municipal court increased to $15,000. (Code Civ. Proc., § 86, Stats. 1978, ch. 146.) It would be an exercise in futility to reverse the judgment and order the cause transferred from the municipal court to the proper court for trial when the municipal court itself has become the proper court for trial.
*834 As with the three unlawful detainer causes we direct the clerk of this court to amend the prayer of the complaint to add the phrase "not in excess of a total amount of $5,000."

IV
Our views on the pleading of jurisdiction, however, do not dispose of these causes. Because the appellate department merely reversed the judgments on jurisdictional grounds, it made no determination of these appeals on their merits. Pursuant to rule 68 [Cal. Rules of Court] we remand these causes to the appellate department for determination of the appeals on their merits.
In each cause the clerk of this court is directed to amend the prayer of the complaint by interlineation to add the phrase "not in excess of a total amount of $5,000." As so amended, the causes are remanded to the Appellate Department of the Los Angeles Superior Court with directions to hear and determine these appeals.
Compton, J., and Beach, J., concurred.
A petition for a rehearing was denied July 20, 1979.
