Fixed import error and better gzip reader.