Fixed the issue where paste ended up with the caret in the wrong place