diff --git a/Aggregation/AbstractAggregation.php b/Aggregation/AbstractAggregation.php
index 7ff124a91bd1a2376b184f42e7e6debe405566c9..110a4a54fa85001923a6ea0e1e520877395bb0d0 100644
--- a/Aggregation/AbstractAggregation.php
+++ b/Aggregation/AbstractAggregation.php
@@ -134,7 +134,7 @@ abstract class AbstractAggregation implements NamedBuilderInterface
     protected function collectNestedAggregations()
     {
         $result = [];
-        foreach ($this->aggregations->all() as $aggregation) {
+        foreach ($this->getAggregations() as $aggregation) {
             $result = array_merge($result, $aggregation->toArray());
         }
 
diff --git a/NamedBuilderBag.php b/NamedBuilderBag.php
index 2d90543479326b5e3b08a67f268a155107c1145a..e808d5dd526014a1f15028cc8b4dda7322d061c6 100644
--- a/NamedBuilderBag.php
+++ b/NamedBuilderBag.php
@@ -96,18 +96,18 @@ class NamedBuilderBag
     /**
      * Returns all builders contained.
      *
-     * @param string|null $name Builder name.
+     * @param string|null $type Builder type.
      *
      * @return NamedBuilderInterface[]
      */
-    public function all($name = null)
+    public function all($type = null)
     {
         return array_filter(
             $this->bag,
-            function ($builder) use ($name) {
+            function ($builder) use ($type) {
                 /** @var NamedBuilderInterface $builder */
 
-                return $name === null || $builder->getName() == $name;
+                return $type === null || $builder->getType() == $type;
             }
         );
     }