Fixed a bug that caused tags to be duplicated when pasting them.