Fix bug in resizing on variant switch