Improved resize and reset functions