[fix revert] Revert to BufferedStream. Some more Windows-related fixes.