Fixing closure in test