made the HSV function a little more robust

fixed divide by zero issue
fixed unitless issue.