fix #496 bug with empty template variables in tbg

add support for empty variables