Fix for closure self-references

This provides a fix for closures with self-references.

See #70.