Windows fixes

Collection of windows fixes.