fixed a typo in the function to write bit-vectors