Fixing garbage produced while merging