wrap path helpers in anon function to ensure $ value, correct module params Fixes #5448