Fix resizing issue

Everything is explained in the relative commits :-)