Fix a bug related to merging similar items