
546 P.2d 625 (1976)
Tom I. McFARLING, Statutory Liquidator for the State Board of Insurance for the State of Texas, Receiver, Appellant,
v.
DEMCO, INC., and C. L. Frates and Company, Appellees.
No. 46750.
Supreme Court of Oklahoma.
February 10, 1976.
W. R. Wallace, Jr., Rainey, Welch, Wallace, Ross & Cooper, Oklahoma City, for appellant.
Kent F. Frates, Ellis, Frates & Shotts, Oklahoma City, for appellee.
*627 IRWIN, Justice:
In June of 1969, C.L. Frates & Company (Frates) entered into an "Agency Agreement" (the agreement), with Liberty Universal Insurance Company (Liberty). Pursuant to the agreement, Frates was authorized to solicit for and place with Liberty policies of insurance. Frates sold to Demco, Inc. (Demco) several policies of insurance which Frates placed with Liberty. Before Frates remitted to Liberty premiums received from Demco, Liberty was put into receivership in the State of Texas. Tom McFarling (Receiver) cancelled all outstanding policies immediately upon appointment.
Demco brought an action against Frates to recover unearned premiums and unearned commissions held by Frates. Frates filed a cross-petition alleging it held funds paid to it by various insureds and sought a declaratory judgment determining who *628 was entitled to the funds. Although Frates might appear as a stakeholder, it supported Demco's position and others similarly situated. Receiver intervened. Receiver sought to have all earned and unearned premiums, unearned and earned commissions not yet transferred on Frates' books transmitted to him as assets of the insolvent estate of Liberty. The trial court ruled that the unearned premiums and unearned commissions were to be returned to Demco, the earned commissions were to be retained by Frates and the earned premiums were the property of Receiver. Frates paid Demco the amount awarded it in the judgment and Demco dismissed as to Frates. Receiver appeals.
Receiver presents two specifications of error. First, the disposition of the unearned premiums, unearned and earned commissions in the possession of Frates is contrary to law in that Frates was Liberty's agent and the funds held by Frates in such capacity are the property of Liberty. Further, the disposition is contrary to law in that it prefers Frates and its insureds over all other general creditors of Liberty. Second, the trial court erred in denying Receiver's motion to partially withdraw a stipulation as to the amount of Receiver's claim.
The rights of the Receiver and of all persons claiming against Liberty became fixed with the appointment of Receiver. If a preference has resulted from the rulings of the trial court, we will not allow it to stand. Shoup v. Mayerson, Okl., 454 P.2d 666 (1969). Here, we do not speak of a preference as to term of art; rather, we mean the general equitable principle that one creditor will not be allowed to secure to himself a larger percentage of the indebtedness due him than the percentage allowed to fellow creditors of the same class. Burchfield v. Bevans, 242 F.2d 239 [10th Cir.1957]. Did a debtor and creditor relationship exist between Frates and Liberty, or was their relationship that of agent and principal?
In Oklahoma, a debtor "is one who, by reason of an existing obligation, is, or may become, liable to pay money to another, whether such liability is certain or contingent." 24 O.S. 1971 § 1. A creditor "is one in whose favor an obligation exists, by reason of which he is, or may become, entitled to the payment of money." 24 O.S. 1971 § 2. If a principal and agent relationship existed between Liberty and Frates, then the funds paid to Frates by Demco were in the constructive possession of Liberty. If a debtor/creditor relationship existed between Frates and Liberty, then Receiver may lawfully recover from the funds paid by Demco to Frates only earned premiums then due and owing. As many jurisdictions have said, it is a factual question as to whether a broker is the agent of the insured or of the insurer, and will be resolved according to the circumstances of each particular case. Schimmel Fur. Co. v. American Indem. Co., Mo., 440 S.W.2d 932; Allstate Insur. Co. v. Smoak, 256 S.C. 382, 182 S.E.2d 749; Chesapeake House, Inc. v. Lee Mut. Ins. Agency, Inc., Fla.App., 239 So.2d 602; Galiher v. Spates, 129 Ill. App.2d 204, 262 N.E.2d 626.
Not every insurance broker is bound to hold premiums received in trust for the insurer. A trust arises when the broker becomes the agent of the insurer for the purpose of collecting premiums. The question of whether Frates became a fiduciary, holding the premiums in trust for Liberty, depends on the precise nature of their relationship as evidenced by their "Agency Agreement", and their actions thereunder. The agreement provided that Frates was authorized "to retain out of premiums collected and paid over to the Company (Liberty) * * * commissions as mutually agreed to." Frates was also to return to Liberty any retained commissions on policies which had been cancelled or on which refunds had been made. All premiums were due Liberty "within forty-five (45) days from the end of the month in which the business was written." *629 The agreement also provided that Liberty could go against the individual insureds for premiums and that  if it did so  Frates' commissions would be reduced by a collection charge.
"An insurance agent may be an independent contractor in performing some of his obligations under contract with company and yet as to performance of other duties be acting in the capacity of the company's employee or agent." Victory Life Insurance Company v. Hall, Okl., 413 P.2d 324 (1966).
Liberty was one of many insurance companies Frates could have chosen when deciding how best to service a client and, in the absence of specific language creating a trust in Frates for the benefit of any one of the insurance companies, Frates would act in a dual capacity as agent and independent contractor for each. Frates was an agent of Demco (insured) to the extent that it was to find the insurance among several firms which best suited Demco's needs. It was an agent of Liberty (insurer) to the extent that it had been granted power to solicit insurance policies. But by the various provisions of the agreement, the premiums were not due until 45 days from the end of the month in which the business was written. Frates could be billed for these premiums or submit an account each month. Liberty was not to receive the premiums and then pay Frates a commission. Frates had authority to deduct the commissions from the money collected. Liberty had no right to possession of the funds held by Frates before the expiration of the 45-day period. What Liberty was due at the end of the 45-day period was what was then owing, not funds in Frates' hands at some time before the running of the period. Thus, Liberty was only due earned premiums, not unearned and earned commissions or unearned premiums.
Neither party has specifically said whether or not the premiums paid to Frates were commingled. From the evidence of the lengthy discussions necessary to arrive at the total premiums collected by Frates for Liberty, it appears Frates did not keep these premiums in a separate account. No provision is found in the agreement for segregation from other funds premiums received by Frates. Commingling of funds received by Frates might be implied from his authority to deduct commissions and to retain possession for up to forty-five days since part of the premiums collected would be Frates' money, not Liberty's. This Court agrees with the California law that "[i]f funds held by an agent are commingled with the knowledge and consent of his principal, in the absence of an agreement to the contrary, the inference is that the agent becomes a debtor to the amount received for the principal." Downey v. Humphreys, 102 Cal. App.2d 323, 227 P.2d 484 (1951). Likewise, the Restatement of Agency 2d § 398, Comment c., states that, "[i]f funds are properly mingled, the inference is that the agent becomes a debtor to the amount received for the principal * * *."
The Restatement, Trusts 2d § 12, states concisely that "[a] debt is not a trust." The Restatement of Trusts goes on to explain, in comments a and b to § 12, the distinction:
"The beneficiary of a trust has the beneficial interest in the trust property. A creditor as such has merely a personal claim against the debtor, which can be enforced by judicial proceedings to reach the debtor's property * * *."
* * * * * *
"There is a fiduciary relation between trustee and beneficiary * * *; there is not a fiduciary relation between debtor and creditor as such * * *."
Thus, the relationship between Frates and Liberty was that of debtor-creditor. Frates' only obligation to Liberty, and Receiver, was to remit on the due date the earned premiums minus the earned commissions.
After Receiver entered the suit, he was allowed to audit Frates' books. After long discussions and negotiations, Frates (who *630 accepted Receiver's audit in most respects) and Receiver signed and filed with the court on October 19, 1972, a stipulation which, inter alia, included the amount of premiums collected by Frates for Liberty. Receiver learned on February 14, 1973, of an alleged audit error and notified Frates. On February 21, 1973, a day before the trial date, Receiver filed a motion to partially withdraw from the stipulation. The trial was continued, the issue was briefed, and the motion denied.
A stipulation is a tool for expediting trial through the disposition of uncontroverted issues by agreement. Stipulations are of two types. First, some stipulations are tantamount to contracts. Parties thereto compromise on a controverted issue, such as damages. These stipulations can only be withdrawn on grounds for nullifying a contract i.e., obtained by fraud, against the law or public policy, etc. See 15 O.S. 1971, §§ 52, 53.
Second, stipulations may be procedural in effect rather than substantive. Typical of this type of stipulation is an agreement to the identity of parties. Withdrawal of a procedural stipulation is not permitted without the consent of the opposing party, "except by leave of court upon cause shown." Coon v. Jones, Okl., 303 P.2d 425 (1956); Smith v. Owens, Okl., 397 P.2d 673 (1965).
From the language of the settlement offer of Frates [Feb. 2, 1972], which used the figure eventually inserted in the stipulation, it appears concessions were made to arrive at the disputed stipulated figure. The offer is contained in a letter which said, in effect, that the earned premiums equaled $6,806.19, the difference between the unearned premiums and the "total amount held by C.L. Frates which is in controversy." (emphasis supplied). The total amount of Receiver's original claim against Frates was for $25,222.31. Frates originally claimed to have on hand $19,014.59, attributable to Liberty policies. The stipulated total was $20,155.07.
The original audit was the work of a former employee of Liberty who worked for Receiver in the preparation of the figures. Later an agent of Receiver went over the audit and discovered some errors which resulted in Receiver accepting a smaller figure for the stipulation. This agent originally found no reason to suspect over $14,000.00 in credits to Frates, but her immediate superior, in preparing as a potential trial witness, detected what were called accounting errors. Credits were assigned Frates' account during September, October and November of 1969, but not debited appropriately in December, January and February, when Frates allegedly receipted for payment. The error allegedly resulted when the figures were transferred to computer tape and the original auditor failed to carefully examine the books of 1969 from which the tapes were prepared. Receiver submitted with the motion to withdraw an affidavit from the agent and copies of the documents she used. Later Receiver offered the agent to testify in person concerning the alleged errors, but the trial court refused the offer of proof and sustained Frates' objections.
The standards for allowing a withdrawal of a stipulation were discussed in a recent Kansas decision. Morrison v. Hurst Drilling Company, 212 Kan. 706, 512 P.2d 438 (1973). These are:
(1) Clear showing that the fact stipulated to is untrue. Receiver has apparently offered proof sufficient to establish a prima facie showing.
(2) Motion to withdraw stipulation is timely made. Receiver's motion is timely in respect to discovery of the alleged error, but not very timely in respect to the date of the entering of the stipulation. No indication is given that the stipulation was hastily made or made under pressure.
(3) Good cause shown for relief. The substantial amount of the alleged error and the apparent lack of negligence on the part of Receiver would appear to equal good cause.
*631 (4) The fact is one of material character which changes the rights of the parties. Receiver has met this burden.
(5) The opposing party has not detrimentally relied and changed his position. Frates has made some possible concessions to insureds relying on the stipulation and may have allowed possible rebuttal records to be lost through the lapse of time.
(6) To fail to allow the stipulation will result in manifest injustice to one of the parties. Obviously holding Receiver to the stipulation will be an injustice if the Receiver's claim is correct and not due to any failure on the Receiver's part and if Frates has not detrimentally relied.
(7) The trial court abused its discretion.
Two federal decisions applying Oklahoma law have upheld the withdrawal of a stipulation. First Nat. Bank & Trust Co. v. Jones, 61 F. Supp. 364 [W.D.Okl., 1945]; Bradford v. Schmucker, 135 F.2d 991 [10th Cir.1943]. The federal district court recognized that stipulations are generally binding, but went on to state that:
"* * * if there is an error in the stipulation based upon misinformation at the time of the making of the stipulation, the court not only has the power to correct, but should correct the mistake."
Both of these decisions involved an opposing party who admitted that a mistake had been made, but urged the court to uphold the stipulation nonetheless. Frates has never denied or admitted the alleged error, but has taken the position that the stipulation should be enforced. In its brief, Frates argues that if Receiver was allowed to withdraw the stipulation, Frates would contest the $14,000.00 figure.
Basically, it makes no difference whether the stipulation is of the first or second class. The important question is whether or not Frates detrimentally relied.
"Where the mistake [in a contract] is of so fundamental a character that the minds of the parties have never, in fact, met, or where an unconscionable advantage has been gained by mere mistake or misapprehension, and there is no gross negligence on the part of the plaintiff either in falling into the error or in not sooner seeking redress, and NO INTERVENING RIGHTS HAVE ACCRUED, AND THE PARTIES MAY STILL BE PLACED IN STATUS QUO; equity will interfere, at its discretion, to prevent injustice." (emphasis added).
Lovell v. City of Altus, 118 Okl. 106, 246 P. 468 (1925).
"It is within the sound judicial discretion of the court as to whether a party will be permitted to withdraw from a stipulation * * *." Georgia Home Ins. Co. v. Halsey, 37 Okl. 678, 133 P. 202 (1913).
It does not appear that the trial court took evidence on the issue of whether or not Frates detrimentally relied on the prior stipulation. Frates states that all of his "clients" books (which may have been destroyed) would have to be reviewed, implying that Frates would have to supply all the facts supporting its claim. Since good cause has been shown for withdrawing from part of the stipulation, the burden is on Frates to show that it detrimentally relied on the stipulation. The record does not reveal any serious reliance to Frates' detriment. To uphold the entire stipulation, if truly incorrect, could result in a windfall benefit to Frates of more than one half of the total stipulated figure. However, in all fairness, Frates should have the opportunity to put on evidence of its detrimental reliance.
Therefore, the judgment of the trial court is affirmed with respect to its determination of the relative rights of the parties. With respect to the trial court's refusal to allow Liberty to withdraw its stipulation, the judgment of the trial court is reversed and remanded with instructions to take evidence on the issue of whether Frates detrimentally relied on the prior stipulation of the parties.
Judgment of the trial court affirmed in part, reversed in part and remanded for further proceedings not inconsistent with this opinion.
All the Justices concur.
