fix xtemplate variable render. Fixes #596