Fix leaking variables