Bugfix with deleted entities