The principal methods by which a contract can be discharged by operation of law are by death, bankruptcy, alteration of a written instrument, merger, or judgment.