Fix bugs in the new 64-bit bit writer/reader