diff --git a/sumpy/expansion/local.py b/sumpy/expansion/local.py
index 3acdfea0d6c954d0db8cc937be5211ab53edd53e..41e72236d4b01b7ed165a258e6108e1183efdac7 100644
--- a/sumpy/expansion/local.py
+++ b/sumpy/expansion/local.py
@@ -244,12 +244,13 @@ class VolumeTaylorLocalExpansionBase(LocalExpansionBase):
             # of multi-indices needed is much less than
             # gnitstam(src_order + tgt order) when PDE conforming expansions
             # are used. For full Taylor, there's no difference.
-            max_mi = [0]*self.dim
-            for i in range(self.dim):
-                max_mi[i] = max(mi[i] for mi in
-                                  src_expansion.get_coefficient_identifiers())
-                max_mi[i] += max(mi[i] for mi in
-                                  self.get_coefficient_identifiers())
+
+            def calc_max_mi(mis):
+                return (max(mi[i] for mi in mis) for i in range(self.dim))
+
+            src_max_mi = calc_max_mi(src_expansion.get_coefficient_identifiers())
+            tgt_max_mi = calc_max_mi(self.get_coefficient_identifiers())
+            max_mi = add_mi(src_max_mi, tgt_max_mi)
 
             # Create a expansion terms wrangler for derivatives up to order
             # (tgt order)+(src order) including a corresponding reduction matrix
@@ -261,8 +262,8 @@ class VolumeTaylorLocalExpansionBase(LocalExpansionBase):
             tgtplusderiv_full_coeff_ids = \
                 tgtplusderiv_exp_terms_wrangler.get_full_coefficient_identifiers()
 
-            tgtplusderiv_ident_to_index = dict((ident, i) for i, ident in
-                                enumerate(tgtplusderiv_full_coeff_ids))
+            tgtplusderiv_ident_to_index = {ident: i for i, ident in
+                                enumerate(tgtplusderiv_full_coeff_ids)}
 
             result = []
             for lexp_mi in self.get_coefficient_identifiers():
diff --git a/sumpy/expansion/pde.py b/sumpy/expansion/pde.py
index e0b0b7c83411d694b0aacd2cf6101732f40f02f0..34f95cb2dbea88a5b69f9a2dfbb4dcc54b80f71e 100644
--- a/sumpy/expansion/pde.py
+++ b/sumpy/expansion/pde.py
@@ -27,9 +27,9 @@ from sumpy.tools import add_mi
 
 class PDE(object):
     r"""
-    Represents a scalar, constant-coefficient PDE of dimension `dim`. It is represented by a
-    dictionary. The dictionary maps a multi-index given as a tuple
-    to the coefficient. This object is immutable.
+    Represents a scalar, constant-coefficient PDE of dimension `dim`.
+    It is represented by a dictionary. The dictionary maps a multi-index
+    given as a tuple to the coefficient. This object is immutable.
     """
     def __init__(self, dim, eq):
         """
@@ -51,7 +51,7 @@ class PDE(object):
         assert self.dim == other_pde.dim
         res = self.eq.copy()
         for k, v in other_pde.eq.items():
-            if k in res.eq:
+            if k in res:
                 res[k] += v
             else:
                 res[k] = v