Fixed templates order to match XSLT's