Fixed mode in gzip.open() call to ensure python 3 compatibility.