Fix output when ttyout == stdout