Fix crash with opening in internal editor.
Fix removing duplicate factories.