Try this; first make these assignments
(C1) gcd : 'spmod$
(C2) algebraic : true$
Now run your code.
There is a small chance that you'll avoid the
"Polynomial quotient is not exact" error.
gcd defaults to 'subres' and algebraic defaults to 'true.' I've
seen the "Polynomial quotient is not exact" error go away
by changing the gcd algorithm to spmod and
setting algebraic to true.
Good luck.
Barton