[client] Narrow the valid range of a variable to avoid some unexpected troubles.