diff --git a/lmfit/parameter.py b/lmfit/parameter.py
index ca9ccc72..a7ec9a65 100644
--- a/lmfit/parameter.py
+++ b/lmfit/parameter.py
@@ -181,9 +181,8 @@ def __reduce__(self):
         params = [self[k] for k in self]
 
         # find the symbols from _asteval.symtable, that need to be remembered.
-        sym_unique = self._asteval.user_defined_symbols()
         unique_symbols = {key: deepcopy(self._asteval.symtable[key])
-                          for key in sym_unique}
+                          for key in self._asteval.user_defined_symbols()}
 
         return self.__class__, (), {'unique_symbols': unique_symbols,
                                     'params': params}
@@ -567,9 +566,8 @@ def dumps(self, **kws):
 
         """
         params = [p.__getstate__() for p in self.values()]
-        sym_unique = self._asteval.user_defined_symbols()
         unique_symbols = {key: encode4js(deepcopy(self._asteval.symtable[key]))
-                          for key in sym_unique}
+                          for key in self._asteval.user_defined_symbols()}
         return json.dumps({'unique_symbols': unique_symbols,
                            'params': params}, **kws)
 
diff --git a/tests/test_model.py b/tests/test_model.py
index 396ea0b1..24dfbfcd 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -900,7 +900,7 @@ def test_independent_var_parsing(self):
         yatan = stepmod2.eval(pars, x=x)
 
         assert (yatan-yline).std() > 0.1
-        assert (yatan-yline).ptp() > 1.0
+        assert np.ptp(yatan-yline) > 1.0
 
         voigtmod = Model(voigt)
         assert 'x' in voigtmod.independent_vars
