Some improvments for resizing