Fixed the memory leak, progress now correctly shows 100% after completion