Finally reimplement maximizing the main window
Some minor improvements