An infusion pump (100) includes inlet (110) and outlet (120) valves and a squeezing element (130) configured to squeeze a fluid line (150) coupled to the infusion pump. A method includes at least one round of valve operation check prior to initiation of a delivery session of fluid to a subject, and subsequently, after an intake phase and before a delivery phase of at least one infusion pump cycle, determining for the at least one pump cycle, an absolute amount of air in the fluid line. The valve operation check and the determining of the amount of air each include: (A) closing the inlet valve to confine a section of the fluid line between the inlet and outlet valves; (B) squeezing the confined section; (C) measuring the pressure within the confined section; and (D) subsequently, relieving the pressure in the confined section. Other applications are also described.