Fixed regression with `@require` and globbed paths inside functions. Closes #1528