Minor optimisations to the Eratosthenes sieve and divisor sum calculations