Cleanup and repair multi-window support