Fix hard-coded window indexes and don't switch windows/sessions