getChunk implementation overengineered & buggy, simplified & fixed.
2.3.6