Select your root joint or at least the top of the hierarchy of joints that you're having difficult with (ie. shoulder to select entire arm or hip to select entire leg) and Edit > Freeze Transformations. Then apply an IK hanel. This usually works for me when the IK twists the skeleton up like you described.