Improve length and ranging validators