fix a bug in signed modular arithmetic