Try to fix output of materia ids.