A more efficient workaround for erode

Uses a faster workaround path than the ternary operator.  Instead, it converts the data to int and continues to do min.  Also, only applied for the datatype that exhibits the original bug.