Fix adapt_chunklen