fix null in xtemplate. Fixes #672