Fixed layout saving.

Now there's saved also window state (maximized/minimized).