fixed casting a long from a BigInteger