BigInteger: fix some int64 issues

Fixes #317 (I hope lol). See comments for an explanation. I need to add a new unit test as well.