Move range validation logic down to the PseudoRange level along with minor
refactorings.