Made the gcode instruction queue maintain its internal state better.