I've seen the tank thing before, but I've learned to manage the location of the tank first, then the target. As for MG squads and mortars, I have never seen what you are describing. I would suggest though that with an MG squad, building are the best spots for them, otherwise instead of right clicking on an enemy, just set up the mg squad and they will take care of the rest. If you right click, then they will try and follow a retreating enemy. I think it's less the AI, and more the PI.