Patch findTemplateVars for compatibility with HPx