Fix ghost ScriptCollections on config change and potential crashes.