fix bug in closure messing up cwrap (my fault)

Followup to previous PR