diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/fastrGrid.R b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/fastrGrid.R
index eaf9a223e47b41d41c45b4b3f953e9a31277bf02..1ab3d2be9ea2b408d372f5dbb28da65ac065ba37 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/fastrGrid.R
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/fastrGrid/fastrGrid.R
@@ -48,6 +48,10 @@ find.viewport <- function(path, name, strict, currPath, pvp, depth) {
     }
 }
 
+growPathFixed <- function(pathsofar, name) {
+    if (is.null(pathsofar)) name else grid:::growPath(pathsofar, name)
+}
+
 find.in.children <- function(path, name, strict, currPath, children, depth) {
   cpvps <- ls(env=children)
   ncpvp <- length(cpvps)
@@ -55,7 +59,7 @@ find.in.children <- function(path, name, strict, currPath, children, depth) {
   found <- FALSE
   while (count < ncpvp && !found) {
     child <- get(cpvps[count + 1L], env=children)
-    nextCurrPath <- if (path == 0L) NULL else grid:::growPath(currPath, child$name)
+    nextCurrPath <- if (path == 0L) NULL else growPathFixed(currPath, child$name)
     result <- find.viewport(path, name, strict, nextCurrPath, child, depth)
     if (result[[1L]]) {
         return(result);