For ENG-4883, fix bug where the output buffer for duplicates was not initialized empty