Moved point at which selection was emptied and replaced to fix bug which always removed selection in input fields