some fixes for template bindings