Fix wrong selection performed by the system on the ReplacementSpans