Some fixes to the way unmapped windows are handled.