Rewrote T/S parser to improve capturing parameters for scan.