fix bindings for nested templates