fix emission of closures, closes #28