 
     if @debugSettings.drawQuadtree
       midpoints = []
-      @quad.walk (node) =>
+      @quadtree.walk (node) =>
         if node.nodes
           midpoints.push [[node.left, node.yMidpoint], [node.right, node.yMidpoint]]
           midpoints.push [[node.xMidpoint, node.bottom], [node.xMidpoint, node.top]]

        for y in yOffsets
          bottomLeft = Vec.add [x, y], boundingBox[0]
          topRight   = Vec.add [x, y], boundingBox[1]
          found = _.uniq @quad.intersecting [bottomLeft, topRight]
          for candidate in found
            continue if candidate is body
            if Utils.aabbOverlap boundingBox, candidate.aabb(), [x, y]

          if not worst or contact.depth > worst.depth
            worst = contact
        break if worst.depth <= 0
        worst.resolveInterpenetration()

      for n in [1..@contacts.length*2]
        worst = null
