TTS: improved and optimized the function of replacing in a string using a dictionary: increased operating speed; it is allowed to replace consecutive templates with spaces at the edges that overlap each other.
Bug fixes.
