Range validator doesn't work well with empty values when allowEmpty=false

See test and fix in diff. There are 2 issues with it:

1. Logically it's not very straightforward how it works currently.
2. Clientside validator works differently in this case.

Suggestions are very welcome.