Some fixes for the tty client