bitstreams: cleanup and fix bug in bit-writer-bytes.