Several windows fixes.

All tests now pass.