Fixed potential bug where acos(u.dot(v)) returns NaN due to round-off in
the dot product.