Fix tests
Properly deal with integer inputs for intervals
Clip before transformation for most stretches, to prevent NaN values
Added documentation