Fix the mods path in the shim and pass mods into wfuncs

Fix #16165,