Bone rotation going wrong!

Hey guys!

I have this ugly mocap:

armature1
And like all mocaps, I need my rig to follow it, but I’m having an big problem in the hand rotation,
mesh_rot.gif
When the hand need to face foward it get all wrong and flip it, no matter what I do.

Blender File

I really could use some help,
Thank you, guys!

It looks like the recording was too sensitive. You can smooth it out in thge curve editor.