This fixes #4763 where adding space created duplicates