Fix for issue 266. Deleted elements cause crash when using Show Elements.