Fix range validation bug.