A non-invasive ventilator system comprising: airway tubing comprising a distal, ventilator end and a proximal, patient end; a distal gas flow sensor configured to measure gas flow at the distal end of the tubing; a proximal pressure sensor configured to measure pressure at the proximal end of the tubing; and a gas flow controller configured to determine a volume of gas to be supplied to the distal end of the tubing, wherein the gas flow controller is configured to determine the volume of gas by: (i) determining an estimated gas flow at the proximal end of the tubing, the estimated gas flow comprising a measurement of gas flow at the distal end of the tubing, a measurement of pressure at the proximal end of the tubing, a measurement of tubing compliance, and a measurement of one or more parameters of a leak flow model; (ii) determining a proximal pressure error value by subtracting a measured pressure at the proximal end of the tubing from the estimated pressure at the proximal end of the tubing; (iii) compensating for the determined proximal pressure estimate error value; (iv) compensating for an error in the estimated gas flow at the proximal end of the tubing by feeding that estimate back into a sum of accumulated flows; (v) determining an estimated gas flow leak, the estimated gas flow leak comprising the estimated pressure at the proximal end of the tubing and the obtained measurement of one or more parameters of the leak flow model; (vi) monitoring on a breath by breath basis for an unknown leak in the non-invasive ventilator system; (vii) determining, when an unknown leak is identified, a gas flow leak factor; (viii) adjusting, with the determined gas flow leak factor, the estimated gas flow leak, thereby reducing an airway flow estimate bias on a breath by breath basis; (ix) detecting a bias on the airway flow estimate; (x) determining that the system is within a quiescent state of a breath; (xi) de-biasing, only if the system is in the quiescent state, the estimated gas flow leak factor in order to drive the bias to near zero; and (xii) suspending breath to breath bias correction on an immediately subsequent breath wherein the system is within a quiescent state of a breath if the breath is in an exhalation phase, if the airway flow estimate is greater than 3 lpm, if the proximal pressure is constant, and if the gas flow is constant. airway tubing comprising a distal, ventilator end and a proximal, patient end; a distal gas flow sensor configured to measure gas flow at the distal end of the tubing; a proximal pressure sensor configured to measure pressure at the proximal end of the tubing; and a gas flow controller configured to determine a volume of gas to be supplied to the distal end of the tubing, wherein the gas flow controller is configured to determine the volume of gas by: (i) determining an estimated gas flow at the proximal end of the tubing, the estimated gas flow comprising a measurement of gas flow at the distal end of the tubing, a measurement of pressure at the proximal end of the tubing, a measurement of tubing compliance, and a measurement of one or more parameters of a leak flow model; (ii) determining a proximal pressure error value by subtracting a measured pressure at the proximal end of the tubing from the estimated pressure at the proximal end of the tubing; (iii) compensating for the determined proximal pressure estimate error value; (iv) compensating for an error in the estimated gas flow at the proximal end of the tubing by feeding that estimate back into a sum of accumulated flows; (v) determining an estimated gas flow leak, the estimated gas flow leak comprising the estimated pressure at the proximal end of the tubing and the obtained measurement of one or more parameters of the leak flow model; (vi) monitoring on a breath by breath basis for an unknown leak in the non-invasive ventilator system; (vii) determining, when an unknown leak is identified, a gas flow leak factor; (viii) adjusting, with the determined gas flow leak factor, the estimated gas flow leak, thereby reducing an airway flow estimate bias on a breath by breath basis; (ix) detecting a bias on the airway flow estimate; (x) determining that the system is within a quiescent state of a breath; (xi) de-biasing, only if the system is in the quiescent state, the estimated gas flow leak factor in order to drive the bias to near zero; and (xii) suspending breath to breath bias correction on an immediately subsequent breath