Fix use of {% set %} statements inside {% if %} blocks.