Corrected resize bug