Bug fixes when calculating magic squares of primes