Fixed behavior when changing both sb and win size, as the order of operation is important to keep sb always bigger than win.