signed/unsigned casting issues prevented correct comparisons with the min/max constraints. account for the source type's range before doing the comparison.