diff --git a/cobra/core/model.py b/cobra/core/model.py
index <HASH>..<HASH> 100644
--- a/cobra/core/model.py
+++ b/cobra/core/model.py
@@ -644,7 +644,7 @@ class Model(Object):
     def objective(self, value):
         if isinstance(value, sympy.Basic):
             value = self.solver.interface.Objective(value, sloppy=False)
-        if not isinstance(value, (dict, self.solver.interface.Objective)):
+        if not isinstance(value, (dict, optlang.interface.Objective)):
             value = {rxn: 1 for rxn in self.reactions.get_by_any(value)}
         set_objective(self, value, additive=False)
 
diff --git a/cobra/util/solver.py b/cobra/util/solver.py
index <HASH>..<HASH> 100644
--- a/cobra/util/solver.py
+++ b/cobra/util/solver.py
@@ -137,7 +137,7 @@ def set_objective(model, value, additive=False):
                 {reaction.forward_variable: coef,
                  reaction.reverse_variable: -coef})
 
-    elif isinstance(value, (sympy.Basic, model.solver.interface.Objective)):
+    elif isinstance(value, (sympy.Basic, optlang.interface.Objective)):
         if isinstance(value, sympy.Basic):
             value = interface.Objective(
                 value, direction=model.solver.objective.direction,
Fix instance checking for Objective (#<I>)