Fixes for adding & removing entities

The entity array can't be modified while the array is being iterated
through