WL-3020 Replace actions iteration to use an index

This is because calling remove with the object will cause it to go through
the list all over again.