Fix for closures as module-level state