Fixed overflow bugs in ``_sqrt_mod1``