--- a/src/lib/graph/VectorStochasticNode.cc
+++ b/src/lib/graph/VectorStochasticNode.cc
@@ -26,7 +26,7 @@
        parents
     */
 
-    if (!dist->checkNPar(parents.size())) {
+    if (!checkNPar(dist, parents.size())) {
 	throw DistError(dist, "Incorrect number of parameters");
     }
     vector<unsigned int> parameter_lengths(parents.size());