Improved resizing behavior.