Added support for multiple windows.