Joint Goes the Wrong Direction in Animation

Recently I have been working on some animations for a sword and ran into a problem. I will show you an example with this short video.

Animation Glitch.wmv (1.8 MB)

Here I have three animations: a slash from the right, a slash from the left, and another slash from the right (the special attack). The slash from the left works fine, but the slashes from the right sometimes run into a problem.

It appears that when the right arm is swinging back and I attack, the arm does a 360 motion to complete the animation. When the right arm is swinging forward, the animation works fine.

Is there a way to fix this?