Improve auto_resize behavior