fixed issue with template variable `__PARENT__` becoming a circular reference in nested sub templates