Fix Modules.addCached bug which means that Modules.removeAllModules created a memory leak