Do not modify input array of allSettled

Fixes #336.
Fixes #338.