Updated clamp method

Works properly now when min > max.