Next try at consistent type upgrades for nth_prime_upper/lower