Behavioral strategies for stable maneuvers during locomotion