I was persuaded that ZZ was defined by default as RR. In fact I must add ZZ = IntegerRing() and replace RR by ZZ.