Fixed a bug in split_bitstring algo