Fix conversion. Fix problems with 0.

The conversion was wrong. Now maybe it is right. I tested that
converting and then converting back gives the same thing for all
characters with modulus up to 1000.

Also, there was an infinite loop when trying to construct a Dirichlet
Group with modulus 0. Now we check that the modulus is positive.