Limit number of bits in size representation so that bit size fit 64 bits.
This fixes PR8256 and some others.