Proper fix for #518 by animacide. Update for UltiGCode GCode viewing.