Fix tty initialization