Fixed several mathematics issues in BigInteger