Prevent ConcurrentModifcationExceptions.

See http://pastebin.com/UBvGSFs9/