Fix legacy selectedModules JSON format conversion