fix #496 bug with empty template variables in tbg

close #496

add support for empty variables