added error checking code to bignum_conversions.cpp