Workaround to avoid bug in R 4.0.0 when using for loop on top level context
cherry-picked from f1e12da76