Fix auto-resizing of the divs