Nmod poly factor

Hi Fredrik,
I fixed the bug.
Cheers Martin