fix id access
There might actually be more of those blunders, as some lists used to be Map objects with the key as the index (and Map.forEach has the key as the second parameter of the callback, whereas for lists the second parameter is the index). I'll investigate other occurrences of this pattern in the near future.