Fixed match for endcacheif to avoid stray 'if' in the generated output