Fixed templating order bug