Fixed bug when Np != 1.
Fixed bug in use of g0.
Changed hash function for divisors.
Cleaned up small things.