Fix median calculation (use measurements table only).