Fix track_id determination logic.