Fix BigInteger JS bugs