Improved The Closure Generator

Fixes #204.