Handle duplicate entries in stats file better