Fixes closing windows.