Fix incorrect callbacks
Fix template action hook