Updated default write method to "wb" to resolve issues on windows