Ensure max random number is within scope