Improved PTY support.