Minor fixes to get correct output in AddPrimes