Fix marking final chunk as done