you probably need to set a prefered angle. but if layed out the joins with a slight bend in the direction it should bend, it shouldnt do that. unless theres some other problem with the ik solver.