Ensure files are reopened in binmode