Fix bug where closures weren't being stored