Rotate along Z Axis

My current Rotation code:

Vector3 ld = loc - transform.position;

float a = Vector3.Angle(ld, Vector3.up);

transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.Euler(0,0,a), Time.time * .05f);

This works, some of the time. There are cases where I will get angles that should actually be 360 - angle (I think), but are instead just angle.

What is the correct way to handle this type of rotation?

I'd give this a try: http://www.unifycommunity.com/wiki/index.php?title=Angle