Fix missing binmode bug (which broke everything on Windows).