Small bugfix and pseudo tty tweak