BigInteger: fix some int64 issues

Fixes #317 (I hope lol). See comments for an explanation.