Additional intelligence added to the Primes backend build script.