bugfix for size calculation in decoding.