fix closures in tests