It's happening because I'll gather from the first node on a tree in a cluster, then it goes to the second node and hits enter. Then it will go to the third node and hit enter again, which makes it attack.
If I gather from the second or third nodes in a cluster, it won't do that because it will move on to a different cluster and lose the target.
Is there a way to turn off attacking a target by hitting enter twice? I probably didn't word that question properly, but I can't think of how else to ask it right now.