Fixed sendEscapeAfterType bug