Fixed bugs in BinaryInteger and added jUnit tests.