Remove excess select-window & bug fix