Fixed byte counting math in bitstring code