The quality of the modules inserted to the emitter resets when switching the quantum mode.
Possible bug in the 'local function save_modules(entity)':
AFAIK, the follow string
'table.insert(modules, {name = stack.name, count = stack.count})'
must be
'table.insert(modules, {name = stack.name, count = stack.count, quality = stack.quality})'