diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java
index 74427834b21bc487fe9cfc62f074275b7361caa4..b0d4770e43fd20c30a3e1096eed513873549615f 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java
@@ -20,6 +20,7 @@ import com.oracle.truffle.api.*;
 import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
 import com.oracle.truffle.api.dsl.*;
 import com.oracle.truffle.api.frame.*;
+import com.oracle.truffle.api.nodes.RootNode;
 import com.oracle.truffle.r.nodes.*;
 import com.oracle.truffle.r.nodes.access.*;
 import com.oracle.truffle.r.nodes.access.variables.ReadVariableNode;
@@ -183,7 +184,11 @@ public class HiddenInternalFunctions {
         @TruffleBoundary
         public Object lazyLoadDBFetchInternal(MaterializedFrame frame, RIntVector key, RStringVector datafile, int compression, RFunction envhook) {
             if (CompilerDirectives.inInterpreter()) {
-                getRootNode().reportLoopCount(-5);
+                // TODO why is rootNode sometimes null
+                RootNode rootNode = getRootNode();
+                if (rootNode != null) {
+                    rootNode.reportLoopCount(-5);
+                }
             }
             String dbPath = datafile.getDataAt(0);
             String packageName = new File(dbPath).getName();
diff --git a/mx.fastr/mx_fastr_pkgtest.py b/mx.fastr/mx_fastr_pkgtest.py
index 5a99124a31c96d419f117fabb1979b35c23d74b0..71b6c99abf89af25b80a47b9fed6a688d58c46c3 100644
--- a/mx.fastr/mx_fastr_pkgtest.py
+++ b/mx.fastr/mx_fastr_pkgtest.py
@@ -103,7 +103,7 @@ def rpt_list_testdates(args):
     parser = ArgumentParser(prog='mx rpt-list-testdates')
     _add_common_args(parser)
     parser.add_argument('--pattern', action='store', help='regexp pattern for pkg match', default='.*')
-    parser.add_argument('--printfile', action='store_true', help='print filename containing tests')
+    parser.add_argument('--printdir', action='store_true', help='print directory containing tests')
     args = parser.parse_args(args)
     fastr = dict()
     dirlist = get_local_dirs(args.logdir)
@@ -124,7 +124,7 @@ def rpt_list_testdates(args):
         sortedList = sorted(testdates)
         print pkg
         for resultInfo in sortedList:
-            if args.printfile:
+            if args.printdir:
                 print '  ' + resultInfo.localdir
             else:
                 print '  ' + str(resultInfo.date)