Improved resize behavior.