Bug fixes and enhancements for entity deletion.