Fix Valid::range bug excluding min/max values

Closes #4672 bug introduced in 23e1b0b