Fix chunking bug