Fix bug with state of MasterWindow