There was a bug in writeBitVector(), where the last byte was not consistantly written into the destination buffer. A unit test was added to verify that writeBitVector() and readBitVector() are correct.