Modified log procedure to be able to handle bignum.