Made metadata saving for gcode files more error resilient (hopefully that is)