Fixed bug with entities deleting.