Add escape() and unescape().
Add larger buffer to wait check.