This is the problem with what I call "short" programming.
When writing my code, I always put in the complete line e.g. G0 X0 Y0, not just the co-ordinates I want to move to. Similar when I want a cutting move, G1 F4 X3 Y3. It makes it a lot easier to check the code when something like this happens, because you don't have to trace back to see what the machine is actually doing..
Unfortunately if you use a CAM program, you are stuck with what it gives you.