Fixes issue with deleting entities that have comments.