Apparatus for delivering a fluid to a subject through infusion tubing, the apparatus comprising: a tube cassette configured to receive the infusion tubing, the tube cassette shaped to define a locking surface; a pump comprising a latch, (i) the tube cassette being configured to be removably coupled to the pump, and (ii) the latch being configured to (a) engage with the locking surface and (b) lock the tube cassette in a preset position with respect to the pump when the tube cassette is coupled to the pump; and a mechanical stop disposed within the pump, characterized in that: (i) the mechanical stop is positioned to stop motion of the tube cassette in a first direction, such that when the motion of the tube cassette in the first direction is stopped by the mechanical stop, the tube cassette has moved past the preset position in the first direction, and (ii) the latch is configured to: (a) until the motion of the tube cassette is stopped by the mechanical stop, allow motion of the tube cassette past the preset position in the first direction, (b) automatically move from an open position to a cassette-withdrawal-inhibiting position once the tube cassette moves in the first direction past a threshold position, allowing the latch to engage with the locking surface, and (c) subsequently, lock the tube cassette in the preset position by pushing the tube cassette in a second direction opposite the first direction, from past the preset position to the preset position. a tube cassette configured to receive the infusion tubing, the tube cassette shaped to define a locking surface; a pump comprising a latch, (i) the tube cassette being configured to be removably coupled to the pump, and (ii) the latch being configured to (a) engage with the locking surface and (b) lock the tube cassette in a preset position with respect to the pump when the tube cassette is coupled to the pump; and (i) the tube cassette being configured to be removably coupled to the pump, and (ii) the latch being configured to (a) engage with the locking surface and (b) lock the tube cassette in a preset position with respect to the pump when the tube cassette is coupled to the pump; and a mechanical stop disposed within the pump, characterized in that: (i) the mechanical stop is positioned to stop motion of the tube cassette in a first direction, such that when the motion of the tube cassette in the first direction is stopped by the mechanical stop, the tube cassette has moved past the preset position in the first direction, and (ii) the latch is configured to: (a) until the motion of the tube cassette is stopped by the mechanical stop, allow motion of the tube cassette past the preset position in the first direction, (b) automatically move from an open position to a cassette-withdrawal-inhibiting position once the tube cassette moves in the first direction past a threshold position, allowing the latch to engage with the locking surface, and (c) subsequently, lock the tube cassette in the preset position by pushing the tube cassette in a second direction opposite the first direction, from past the preset position to the preset position. (i) the mechanical stop is positioned to stop motion of the tube cassette in a first direction, such that when the motion of the tube cassette in the first direction is stopped by the mechanical stop, the tube cassette has moved past the preset position in the first direction, and (ii) the latch is configured to: (a) until the motion of the tube cassette is stopped by the mechanical stop, allow motion of the tube cassette past the preset position in the first direction, (b) automatically move from an open position to a cassette-withdrawal-inhibiting position once the tube cassette moves in the first direction past a threshold position, allowing the latch to engage with the locking surface, and (c) subsequently, lock the tube cassette in the preset position by pushing the tube cassette in a second direction opposite the first direction, from past the preset position to the preset position. (a) until the motion of the tube cassette is stopped by the mechanical stop, allow motion of the tube cassette past the preset position in the first direction, (b) automatically move from an open position to a cassette-withdrawal-inhibiting position once the tube cassette moves in the first direction past a threshold position, allowing the latch to engage with the locking surface, and (c) subsequently, lock the tube cassette in the preset position by pushing the tube cassette in a second direction opposite the first direction, from past the preset position to the preset position.