Correct endifequal position in template