Fixing preferences window reappearing if it was closed.