Deletion of entities and file loading fixed

The deletion of entities still might not be fixed. It seems to work so
far.