fixed bug in dnym/nym using prime encoding