Fix n_vm=0 and pty out of device