Fixes 5870 Template delegate hostname earlier in the process