Fixed bug with concurrent modification.