Followup to #1465

Duplicates were not deleted if they didn't have a languageKey.
Keys with trailing space were treated as individual key instead of as duplicate of the regular key.
These changes fix this.