Fix bug in variable length chunking.