Fixed wrong write in bitstream