Added a few unit tests for bigints, and fixed the bugs that came up in the process.