I've had more experience with the phalanx units now since I'm playing Macedon. From my observations the shift right thing is becoming a problem only when they do some sort of pseudo attack. It's when you've ordered a unit to attack but their spears aren't really touching the enemy. Then they do that sliding thing. If the spears reach the enemy they seem to stay in place pretty well. Question is why aren't they engaging? I'll have to experiment more.