Fixed issues with clearing/resizing windows.