A servo-ventilator is configured to continuously compute a target ventilation such that a rate of adjustment of the target ventilation is reduced as a measure of recent uncompensated leak increases. The servo-ventilator then controls the pressure of a supply of air so as to achieve the target ventilation.