Fix likely bug in the code for deciding which integer type to use for the calculations
Rabin-Miller primality test