fix bug in encoding of numbers/single bytes