More window handling fixes.