Fix TopWindow menu generation.
Fix test_closeEvent test
Refactored edits.