Fixed bug when merging words