Use binary mode for ifstream (thanks Galen).