diff --git a/ArchiveExtractor.py b/ArchiveExtractor.py
index b8ac688de3b4f1141c3096e21bac63211a8c2e3f..43d24d34ab2172d1bd92bab37d208703f8ab6f02 100755
--- a/ArchiveExtractor.py
+++ b/ArchiveExtractor.py
@@ -542,14 +542,14 @@ def _extract_scalar(attribute, method, date1, date2, db):
             return None
 
         # Fabricate return pandas.Series
-        d=pd.Series(index=[datetime.datetime.fromtimestamp(_date),], data=[_data,], name=attribute)
+        d=pd.Series(index=[datetime.datetime.fromtimestamp(_date),], data=[_value,], name=attribute)
 
         return d
 
     # =====================
     if method == "between":
         # Cut the time horizon in chunks
-        cdates = _chunkerize(attribute, dateStart, dateStop, db)
+        cdates = _chunkerize(attribute, date1, date2, db)
 
         # Array to hold data
         data = []
@@ -577,7 +577,7 @@ def _extract_scalar(attribute, method, date1, date2, db):
                 _date = _ArrayTimeStampToDatetime(_date/1000.0)
 
             # Fabricate return pandas.Series
-            data.append(pd.Series(index=_date, data=_data,name=attribute))
+            data.append(pd.Series(index=_date, data=_value,name=attribute))
 
         # Concatenate chunks
         return pd.concat(data)