fixes off-by-1 discrepancy between internally-tracked pid and real pid.