Polished the windows.

Fixed various issues with window management.
Reverted an unneeded change

Reverted an unneeded change
Merge pull request #1 from teak/master

Polished the windows