Check in your graph editor to see how the curves are behaving at the points where you notice unwanted rotation. You might have to modify the tangents. I'm not sure exactly what the problem is, but I have a suspicion it has to do with a combination of the tangents and rotation in a local axis, which gets converted to global rotation with messy numbers. Hope that helps.