Fixed being unable to close window