tweaks to better support BigInt