Make sure default vars are used in template calls for tasks

Fixes #8499