Fixed chunk index bug