Incorrect number of duplicate lines was being displayed.