Create outfile in binary mode, as per #19