I am not quite sure were your issue is.
If the pet is given any command other than Kill/Attack then yes, they will NOT defend themselves.
If I tell my pet to kill something and DO NOT tell it to All Follow Me, then after a bit it will come to me, unless it is being attacked by something else then it will target that something else and kill it. If it comes to me on its own, then it will attack anything that attacks it.
It will only exit the above mode on All follow me, All Stay, All Stop. Least wise that is how it is for me.