fix handling of Integer.MAX_VALUE from SecureRandom.nextInt(); the previous fix appears to be incorrect