In -nw mode, we should adjust window number after switching windows. Thanks to the comment from Francis Moreau.