diff --git a/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/LibraryBuilder.java b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/LibraryBuilder.java
index <HASH>..<HASH> 100644
--- a/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/LibraryBuilder.java
+++ b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/LibraryBuilder.java
@@ -1013,8 +1013,8 @@ public class LibraryBuilder {
         fun = (FunctionRef)resolveCall(fun.getLibraryName(), fun.getName(), invocation, false, false);
         if (fun != null) {
             if ("System".equals(invocation.getResolution().getOperator().getLibraryName())) {
-                fun = buildFunctionRef(libraryName, functionName, paramList); // Rebuild the fun from the original arguments, otherwise it will resolve with conversions in place
-                Expression systemFunction = systemFunctionResolver.resolveSystemFunction(fun);
+                FunctionRef systemFun = buildFunctionRef(libraryName, functionName, paramList); // Rebuild the fun from the original arguments, otherwise it will resolve with conversions in place
+                Expression systemFunction = systemFunctionResolver.resolveSystemFunction(systemFun);
                 if (systemFunction != null) {
                     return systemFunction;
                 }
#<I>: Fixed an issue with ConvertsTo functions not resolving return type correctly.