Fix some bugs on the mersenne modulus