Fixes for gcode generation