My Rig bends in wrong direction

I have setup my Rig with all constraints fixed. But still the limbs bend in the wrong direction. How can i fix that?

When the constraints are set correctly or when there are no constraints set at all, then the IK resolver still can get into trouble when the rest pose angle between 2 bones is setup in the wrong direction.

In the example image the angle between the Elbow bone and its parent bone (shoulder) is set too far to the right. In this case the IK Resolver tries to move the joint backward when the COG bone is moved downward. But the Rig creator actually has expected the joint to move forward in this situation.

The fix is indicated in the image: Just move the joint a bit so that the angle betwenn the two bones opens in the opposite direction.