Fix modulo sum used wrong modulus.