Index: pobysoPythonSage/src/sollya_lib.sage
===================================================================
--- pobysoPythonSage/src/sollya_lib.sage	(revision 116)
+++ pobysoPythonSage/src/sollya_lib.sage	(revision 117)
@@ -33,6 +33,7 @@
         sollya_lib_copy_obj = sollya.sollya_lib_copy_obj
         sollya_lib_cos = sollya.sollya_lib_cos
         sollya_lib_evaluate = sollya.sollya_lib_evaluate
+        sollya_lib_free = sollya.sollya_lib_free
         sollya_lib_get_canonical = sollya.sollya_lib_get_canonical
         sollya_lib_get_constant = sollya.sollya_lib_get_constant
         sollya_lib_get_constant_as_int = \
Index: pobysoPythonSage/src/testPobyso.sage
===================================================================
--- pobysoPythonSage/src/testPobyso.sage	(revision 116)
+++ pobysoPythonSage/src/testPobyso.sage	(revision 117)
@@ -13,6 +13,7 @@
 #
 import inspect
 import resource
+import timeit
 
 
 def memory_usage_resource():
@@ -24,6 +25,11 @@
     return mem
 # End memory_usage_resource()
 
+def test_pobyso_wrapper(func, *args, **kwargs):
+    def wrapped():
+        return func(*args, **kwargs)
+    return wrapped
+
 #
 def test_pobyso_absolute_so_so():
     for index in xrange(0,1000000):
@@ -38,21 +44,47 @@
     sollya_lib_clear_obj(absoluteSo)
 # End test_pobyso_autoprint
 
-def test_pobyso_bounds_to_range_sa_so(iterationsNum=10000):
-    global t
-    print "Running", inspect.stack()[0][3]
+def test_pobyso_bounds_to_range_sa_so(repeat=1000, number=10):
+    functionName =  inspect.stack()[0][3]
+    print "Running", inspect.stack()[0][3], "..."
     lowerBoundSa = RR(1)
     upperBoundSa = RR(2)
     precSo = pobyso_get_prec_so()
-    pobyso_autoprint(precSo)
-    for index in xrange(0,iterationsNum):
+    #pobyso_autoprint(precSo)
+    #
+    def test(lowerBoundSa, upperBoundSa):
         rangeSo = pobyso_bounds_to_range_sa_so(lowerBoundSa, upperBoundSa)
         sollya_lib_clear_obj(rangeSo)
+    #
+    wrapped = test_pobyso_wrapper(test,lowerBoundSa, upperBoundSa)
+    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
+    #
     precSo = pobyso_get_prec_so()
-    pobyso_autoprint(precSo)
+    #pobyso_autoprint(precSo)
     sollya_lib_clear_obj(precSo)
+    print "\t...", functionName, "done."
+    return timing
 # End test_pobyso_bounds_to_range_sa_so
 
+def test_pobyso_get_list_elements_so_so(repeat = 1000, number=10):
+    functionName = inspect.stack()[0][3]
+    print "Running", functionName, "..."
+    def test():
+        listSo = pobyso_parse_string_sa_so("[|0,1,2,3,4,5,6|];")
+        (listSaSo, elementsNumSa, isEndEllipticSa) = \
+            pobyso_get_list_elements(listSo)
+        for elementSo in listSaSo:
+            sollya_lib_clear_obj(elementSo)
+        # Notice that we use sollya_lib_clear_obj and not
+        # sollya_lib_clear_object_list.
+        sollya_lib_clear_obj(listSo, None)
+    #
+    wrapped = test_pobyso_wrapper(test)
+    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
+    print "\t...", functionName, "done."
+    return timing
+# End test_pobyso_get_list_elements    
+
 def test_pobyso_get_prec_so_sa(iterationsNum=10000):
     print "Running", inspect.stack()[0][3]
     for index in xrange(0,iterationsNum):
@@ -84,12 +116,14 @@
         sollya_lib_clear_obj(expressionSo)
 # End pobyso_parse_string_sa_so
 
-def test_pobyso_taylor_expansion_no_change_var_so_so(iterationsNum=10000):
+def test_pobyso_taylor_expansion_no_change_var_so_so(repeat=1000, number=10):
+    functionName = inspect.stack()[0][3]
+    print "Running", functionName, "..."
     functionSo  = pobyso_parse_string('exp(x)')
     degreeSo    = pobyso_constant_from_int_sa_so(20)
     rangeSo     = pobyso_bounds_to_range_sa_so(RR(1),RR(2))
     errorTypeSo = pobyso_absolute_so_so()
-    for index in xrange(0,iterationsNum):
+    def test(functionSo, degreeSo, rangeSo, errorTypeSo):
         teSo = pobyso_taylor_expansion_no_change_var_so_so(functionSo,
                                                            degreeSo,
                                                            rangeSo,
@@ -97,10 +131,55 @@
         sollya_lib_clear_obj(teSo[0])
         sollya_lib_clear_obj(teSo[1])
         sollya_lib_clear_obj(teSo[2])
+    # End test
+    wrapped = test_pobyso_wrapper(test, 
+                                  functionSo, 
+                                  degreeSo, 
+                                  rangeSo, 
+                                  errorTypeSo)
+    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
     sollya_lib_clear_obj(functionSo)
     sollya_lib_clear_obj(degreeSo)
     sollya_lib_clear_obj(rangeSo)
     sollya_lib_clear_obj(errorTypeSo)
+    print "\t...", functionName, "done."
+    return timing
 # End test_pobyso_taylor_expansion_no_change_var_so_so
 
+def test_pobyso_taylor_form_so_so_2(repeat=1000, number=10):
+    functionName = inspect.stack()[0][3]
+    print "Running", functionName, "..."
+    functionSo  = pobyso_parse_string('exp(x)')
+    degreeSo    = pobyso_constant_from_int_sa_so(20)
+    rangeSo     = pobyso_bounds_to_range_sa_so(RR(1),RR(2))
+    intervalCenterSo = sollya_lib_mid(rangeSo, None)
+    errorTypeSo = pobyso_absolute_so_so()
+    
+    def test(functionSo, degreeSo, intervalCenterSo, errorTypeSo):
+        taylorformSo = pobyso_taylorform_so_so(functionSo, 
+                                               degreeSo, 
+                                               intervalCenterSo, 
+                                               errorTypeSo)
+        sollya_lib_clear_obj(taylorformSo)
+    wrapped = test_pobyso_wrapper(test, 
+                                  functionSo, 
+                                  degreeSo, 
+                                  intervalCenterSo, 
+                                  errorTypeSo)
+    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
+    sollya_lib_clear_obj(functionSo,None)
+    sollya_lib_clear_obj(degreeSo,None)
+    sollya_lib_clear_obj(rangeSo,None)
+    sollya_lib_clear_obj(intervalCenterSo,None)
+    sollya_lib_clear_obj(errorTypeSo,None)
+    return timing
+# End   test_pobyso_taylor_so_so_2
+ 
+def test_pobyso_dummy_test(iterationsNum=1, executionsNum=1):
+    aString = "2+3"
+    def test():
+        return 2+3
+    wrapped = test_pobyso_wrapper(test)
+    timing = timeit.timeit(wrapped, number=executionsNum)
+    return timing
 print "\t...testPobyso loaded"
\ No newline at end of file
Index: pobysoPythonSage/src/pobyso.py
===================================================================
--- pobysoPythonSage/src/pobyso.py	(revision 116)
+++ pobysoPythonSage/src/pobyso.py	(revision 117)
@@ -147,6 +147,24 @@
     return(resultSo)
 # End pobyso_chebyshevform_so_so.
 
+def pobyso_clear_taylorform_sa_so(taylorFormSaSo):
+    """
+    This method is necessary to correctly clean up the memory from Taylor forms.
+    These are made of a Sollya object, a Sollya object list, a Sollya object.
+    For no clearly understood reason, sollya_lib_clear_object_list crashed 
+    when applied to the object list.
+    Here, we decompose it into Sage list of Sollya objects references and we
+     clear them one by one. 
+    """
+    sollya_lib_clear_obj(taylorFormSaSo[0])
+    (coefficientsErrorsListSaSo, numElementsSa, isEndEllipticSa) = \
+        pobyso_get_list_elements_so_so(taylorFormSaSo[1])
+    for element in coefficientsErrorsListSaSo:
+        sollya_lib_clear_obj(element)
+    sollya_lib_clear_obj(taylorFormSaSo[1])
+    sollya_lib_clear_obj(taylorFormSaSo[2])
+# End pobyso_clear_taylorform_sa_so 
+
 def pobyso_cmp(rnArgSa, cteSo):
     """
     Compare the MPFR value a RealNumber with that of a Sollya constant.
@@ -262,7 +280,7 @@
 
 def pobyso_constant_from_int_so_sa(constSo):
     """
-    Get Sage int from a Sollya int constant.
+    Get a Sage int from a Sollya int constant.
     Usefull for precision or powers in polynomials.
     """
     constSa = c_int(0)
@@ -479,7 +497,7 @@
     """ Legacy function. See pobyso_get_list_elements_so_so. """
     return(pobyso_get_list_elements_so_so(soObj))
  
-def pobyso_get_list_elements_so_so(objSo):
+def pobyso_get_list_elements_so_so(objectListSo):
     """
     Get the list elements as a Sage/Python array of Sollya objects.
     The other data returned are Sage/Python objects.
@@ -487,16 +505,20 @@
     listAddress = POINTER(c_longlong)()
     numElements = c_int(0)
     isEndElliptic = c_int(0)
-    listAsList = []
+    listAsSageList = []
     result = sollya_lib_get_list_elements(byref(listAddress),\
                                           byref(numElements),\
                                           byref(isEndElliptic),\
-                                          objSo)
+                                          objectListSo)
     if result == 0 :
         return None
     for i in xrange(0, numElements.value, 1):
-       listAsList.append(sollya_lib_copy_obj(listAddress[i]))
-    return(listAsList, numElements.value, isEndElliptic.value)
+       listAsSageList.append(sollya_lib_copy_obj(listAddress[i]))
+       # Clear each of the elements returned by Sollya.
+       sollya_lib_clear_obj(listAddress[i])
+    # Free the list itself.   
+    sollya_lib_free(listAddress)
+    return(listAsSageList, numElements.value, isEndElliptic.value)
 
 def pobyso_get_max_prec_of_exp(soExp):
     """ Legacy function. See pobyso_get_max_prec_of_exp_so_sa. """
@@ -988,6 +1010,9 @@
     taylorFormSo = sollya_lib_taylorform(functionSo, degreeSo, \
                                          intervalCenterSo, \
                                          rangeSo, errorTypeSo, None)
+    # taylorFormListSaSo is a Python list of Sollya objects references that 
+    # are copies of the elements of taylorFormSo.
+    # pobyso_get_list_elements_so_so clears taylorFormSo.
     (taylorFormListSo, numElements, isEndElliptic) = \
         pobyso_get_list_elements_so_so(taylorFormSo)
     polySo = taylorFormListSo[0]
@@ -1009,8 +1034,8 @@
     return((polyVarChangedSo, intervalCenterSo, maxErrorSo))
 # end pobyso_taylor_expansion_with_change_var_so_so
 
-def pobyso_taylor_expansion_no_change_var_so_so(functionSo, degreeSo, rangeSo, \
-                                                errorTypeSo=None, \
+def pobyso_taylor_expansion_no_change_var_so_so(functionSo, degreeSo, rangeSo,
+                                                errorTypeSo=None, 
                                                 sollyaPrecSo=None):
     """
     Compute the Taylor expansion without the variable change
@@ -1026,18 +1051,19 @@
         errorTypeSo = sollya_lib_absolute(None)
     else:
         errorTypeIsNone = False
-    intervalCenterSo = sollya_lib_mid(rangeSo)
-    taylorFormSo = sollya_lib_taylorform(functionSo, degreeSo, \
-                                         intervalCenterSo, \
+    intervalCenterSo = sollya_lib_mid(rangeSo, None)
+    taylorFormSo = sollya_lib_taylorform(functionSo, degreeSo,
+                                         intervalCenterSo,
                                          rangeSo, errorTypeSo, None)
     # taylorFormListSaSo is a Python list of Sollya objects references that 
     # are copies of the elements of taylorFormSo.
     # pobyso_get_list_elements_so_so clears taylorFormSo.
     (taylorFormListSaSo, numElementsSa, isEndEllipticSa) = \
         pobyso_get_list_elements_so_so(taylorFormSo)
+    sollya_lib_clear_obj(taylorFormSo)
     polySo = sollya_lib_copy_obj(taylorFormListSaSo[0])
+    #polySo = taylorFormListSaSo[0]
     #errorRangeSo = sollya_lib_copy_obj(taylorFormListSaSo[2])
-    #polySo = taylorFormListSaSo[0]
     errorRangeSo = taylorFormListSaSo[2]
     # No copy_obj needed here: a new object is created.
     maxErrorSo = sollya_lib_sup(errorRangeSo)
@@ -1047,8 +1073,7 @@
         sollya_lib_clear_obj(initialPrecSo)
     if errorTypeIsNone:
         sollya_lib_clear_obj(errorTypeSo)
-    for element in taylorFormListSaSo:
-        sollya_lib_clear_obj(element)
+    pobyso_clear_taylorform_sa_so(taylorFormListSaSo)
     return((polySo, intervalCenterSo, maxErrorSo))
 # end pobyso_taylor_expansion_no_change_var_so_so
 
