Corrected logic error when resizing from maximize-minimize-unminimize-unmaximize