Modify encodelex.py to add parsing robustness.