Change file creation from w to wb (for Windows)