Fixed small memory leaks
Merge github.com:vysheng/tg
Fixed escape string