MainWindow: not close if worked.
MainWindow: small codefix.
Refactoring.