Updates the EntityBucket destructor to check pointers