Issue #181: Fixes cascade deletion crash