Fixed bug with closures