Fixed a bug where generated fold expressions contain unbound variables