Only replace var in fun clauses that were executed