fix a misbehavior in alias gap
add support for Jinja templates