Fix up syntax in template and rename passed vars