Constrain values to bounds

I noticed that the range slider values can go beyond the specified min/max values by 1, I imagine this is due to rounding, eg with a min/max values of 1 & 100 I see the slider going to 0 and 101.

I've only used the range slider so haven't tested the fix for the normal slider but it should be ok.