Corrected window resizing