iPhone Roll A Ball Variation question

I am playing with the Roll A Ball project and trying to replace the ball with a sliding cube.
I want the cube to turn and point in the direction it is heading.
I have been playing with this code:

var targetRotation = Quaternion.LookRotation (rigidbody.velocity);
 	transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * rotationAdjust);

But I am getting erratic behavior with the cube rotating all over the place.
I am only concerned with altering the left/right orientation of the cube through the script. What would be the best approach for fixing this?

Do you know that your velocity vector is only in that flat plane and never includes any up/down component? What exactly is happening that you deem “erratic”? (is the erratic behavior in the left/right plane, some up/down parts, other, etc.).