--- a/src/lib/graph/LogicalNode.cc
+++ b/src/lib/graph/LogicalNode.cc
@@ -38,7 +38,7 @@
     : DeterministicNode(dim, parameters), _func(function), _discrete(false), 
       _parameters(mkParams(parameters, nchain()))
 {
-    if (!function->checkNPar(parameters.size())) {
+    if (!checkNPar(function, parameters.size())) {
 	throw FuncError(function, "Incorrect number of parameters");
     }
     vector<bool> mask(parents().size());