More fixes for rearranging the content when resizing window