Fix std.BigInt bug #9548 plus other new discovered bugs.
Merge pull request #1231 from Safety0ff/master

Fix std.BigInt bug #9548 plus other new discovered bugs.