Fixed preffix (ESC) repetition problem.
Refactorized tml making it closest to scl.