Added option to remember the window maximized state

+ minor fixes