Fix sharedForEach callback's argument order

This fixes the implementation. Next is the test file.